Publication Workflow: Change the behavior of the "Go to draft" button

When being on the published version of a page having a workflow, the workflow panel shows a button : “go to draft”.

If clicking on that button, this does not just lead to the draft variant of the page, but it also implicitly changes the status of the draft variant to “Draft”, if it is in status “Published” before.

I would like to change this, so that this button labeled “go to …” does not perform an action. Instead:

A) just make the button link to the draft version of the page

B) rename the current button to “edit draft version” or “update draft version” and add a second button, which then is named “go to draft” (or “view draft”)

The reason for the proposed change is that:

  • having a button labeled “go to …” to perform a persistent state change feels odd - the user will expect that going to a page does not have the side effect of changing anything. (the user in that case not just being me, but also at least another person that complained to me about that)
  • also that other user pointed out that this causes lots of draft variants to be pushed to state “Draft” just because someone looked at them without making a change. This makes the “Overview” page of all pages in a workflow list a lots of pages in “Draft” state. It looks like there is lots of work in progress, while there might be very little actual work being done.

Does anyone know why the current panel is implemented the way it is?

Any objections if I make the change? I’d prefer option A) (less buttons), even if that means that users who want to create a new draft have to click twice (first go to the draft version then set it into “Draft” mode).

I agree with you it would make sense to simply link to the draft without changing the status. An href would in addition allow to open the draft in a distinct window.

Wondering also if “Edit draft” could be reworded into “Turn to draft” to distinguish the action more clearly from the “Edit” button, or if we could even turn a document to draft automatically as soon as an update is brought to it (when PublicationWorkflow#isModified(originalDocument, updatedDocument) returns true), adding a mention about this behaviour as a hint. I coded something along this line in a recent project. → just created XAWORKFLOW-98.

Hello @ClemensRobbenhaar ,

I agree to make the “Go to” button perform navigation only and then have a specific “edit draft” button to start a new modification cycle on the draft.

IIRC this was how it was done initially or at least how it was thought of: you could navigate to the draft and only when you really wanted to you were supposed to start a new editing cycle on the draft by pushing the appropriate button.

@slauriere 's proposal of automatically switching the draft into draft state upon meaningful modification is also a good idea, we just need to make sure that we have a clean and reasonable way to detect what modification is meaningful and what is not.

So, +1 for the change, you can go ahead.


1 Like

Apparently I have coded that like that in this commit Added creation of the draft for a published document that does not ha… · xwiki-contrib/workflow-publication@995256b · GitHub - replaced a link to draft with a form that either creates the draft if it doesn’t exist or turns it into draft if it’s published.

So I remember badly that it was supposed to be like that in the first place… I mean it was, but not for a long time…

Ah, the first part makes even sense to me: no use to link to a draft page if that does not exist. I guess I should look more into the git history to understand how these parts have evolved.