For some reason 'published' doesn't appear in the 'from' dropdown at admin/config/workbench/moderation/transitions-- i need to create an 'obsolete' state for documents that should be unpublished but not deleted (for audit purposes we don't delete anything).
Comments
Comment #1
dave reidHrm, it looks like this is by design, but I'm not sure exactly why. Will ask internally.
Comment #2
wiifmI have exactly the same requirement. NZ Government sites have a legal obligation to never 'delete' content on a site, but rather 'archive' it. This is the public records act 2005.
So my desired additional workflow state would be 'archived' and that only published items could transition into this state, and there would be an additional transition from 'archived' to 'draft'
Hope this makes sense
Comment #3
WorldFallz commentedI also tried simply unpublishing the node but that sets the state back to 'draft' which is completely incorrect. I haven't been able to figure out a way around this yet.
Comment #4
WorldFallz commentedi'm happy to try and figure out a patch for it, but I'd rather wait and what dave has to say-- I'd hate to spend time figuring it out if it's by design.
Comment #5
Shadlington commentedSubbing
Comment #6
joekotvas commentedSubscribing... I need this functionality as well.
Comment #7
Tsubo commentedYou need to create a new State (from the States admin menu) called 'Obsolete' or whatever.... then create a new Transition from Published > Obsolete in the transitions admin. This post should help on Views integration side: http://drupal.org/node/1138948
Comment #8
WorldFallz commentedreread the original post-- tsubo. That's what I tried to do-- but 'published' doesn't appear in the 'from' dropdown in order to be do that, lol.
Comment #9
wiifmThats the thing @Tsubo, out of the box (unpatched) workbench moderation does not allow transition to anything from published unless that is draft.
@Dave Reid was going to have a look as to why this decision was made internally. It is possible at the moment to patch the module to support transitions from the published state, but this introduces other bugs - e.g. a transition from published -> archived, should unpublish the revision, this does not happen at present.
Comment #10
WorldFallz commentedfyi-- commenting out line #188 of workbench_moderation.admin.inc (
unset($element['from_name']['#options'][workbench_moderation_state_published()]);), you can then transition from 'published' to another state. Other states are unpublished by default so for my use case of published->obsolete it makes sense.I'm still testing to make sure this change doesn't affect anything else.
Comment #11
WorldFallz commentedThere's also the issue of the fact that unpublishing an item changes the state back to 'draft' by default-- it might also make sense to make that default unpublished state selectable. That might be a separate issue though.
Comment #12
WorldFallz commentedSeems like this is already part of the plan, from workbench_moderation.module:
Comment #13
WorldFallz commentedTurns out that part is already being worked on: #1147646: Hard coded 'Draft' status in .module.
Comment #14
becw commentedDave Reid is correct: it's intentional that you can not create transitions away from the published state. There's a special, non-transition permission in Workbench Moderation for unpublishing content. This is because sometimes unpublishing is allowed on revisions where moderation is *not* allowed; moderation isn't allowed on any but the current revision. A past revision may be published, but you can no longer moderate it. Likewise, you can only publish a revision that you can moderate. If there's an old revision that you want to publish, you have to revert (which makes a new revision that is a copy of the old revision), then publish.
If there is another way this should work, I'm open to discussing it.
Comment #15
WorldFallz commentedThat makes sense-- the only problem then becomes, when 'unpublished' the official way the state goes back to draft-- which is completely wrong and misleading in the case of unpublishing obsolete content that you don't want to delete.
perhaps adding adding a setting for the desired state to use when unpublishing?
Comment #16
clashar commentedI would like to have also this option "published" -> "expired/obsolete",
and the possibility to reverse like "expired/obsolete" -> "published" when author wants to renew his post.
Comment #17
eriknewby commented+1
We are setting up a kbase system and the workbench workflow is perfect for what we are setting up. However we need this exact same functionality ... published -> archived.
Comment #18
becw commentedDoes anyone want to write and test a patch? This would require:
Additionally, we should examine the utility of the 'unpublish live revision' permission; are the per-transition permissions enough access control?
Comment #19
WorldFallz commentedSure I can take a stab at a patch-- I just wanted to make sure I was working in the right direction first.
I've already done part one of this-- i'll see about the rest.
And personally, I can't think of a reason why I would need 'unpublish live revision' if i have per transition permissions-- anyone else?
Comment #20
becw commentedAwesome, thanks!
Also, here's another thought: we can add a state dropdown to the 'unpublish' confirmation form that shows states based on whatever transitions are available.
Comment #21
WorldFallz commentedActually, now that I'm working through this, two different possibilities come to mind.
The first, which we've already mentioned, is to remove the restriction to move from published to other states (along with all the other downstream effects that might have).
The second, is to leave that restriction in place, and add an option (select list) for which unpublished state to use when 'unpublishing live revision'.
Though I've been playing around with the first option, I'm thinking the second is actually more intuitive and less intrusive.
thoughts?
Comment #22
nico heulsen commented+1
The workflow is perfect, however we need this exact same functionality ... published -> archived.
Comment #23
BenK commentedSubscribing
Comment #24
dekova commentedsubscribing
Comment #25
dekova commentedWhen reviewing this enhancement, please consider allowing multiple published states for flexibility instead of assuming that content can only be published during one stage of the workflow.
example: Published -> Review for Expiry -> Expired
Comment #26
becw commented@dekova: multiple published states is a feature we've considered, but have not yet implemented--I've quoted your comment in the issue #1079120: State Properties.
Comment #27
becw commentedHere's a patch that:
This patch does not remove the "Unpublish the current live revision" permission. If you review this patch, please feel free to comment on the wording and layout of the unpublish form.
Comment #28
dave reidPatch in #27 seemed to work pretty flawlessly.
Comment #29
becw commentedSo, I'm now convinced that we should remove the "unpublish current live revision" permission, since there is a permission for each transition, and this patch gives us transitions away from the published state. I think that the unpublishing workflow should remain different from other moderation workflows (basically, it should keep using the "unpublish" link and the confirmation form).
Also, we should write a test for this.
Comment #30
becw commentedHere's an updated patch.
I think that we may not need a test for the unpublish moderation form, since there is a test to make sure that the content actually unpublishes, and beyond that moderation is done in the same way as with the mini-moderation form.
Comment #31
becw commentedComment #32
stevectorThis patch works fine in my testing. Can anyone test this on real data? I'm working in a relatively fresh dev sandbox.
Comment #33
becw commentedI'd like to get this committed, since this feature has been through some iterations and seems like it's working. However, this will change based on #1160478: Machine names for states. I'll revisit this patch once that goes in.
Comment #34
becw commented#1160478: Machine names for states has been committed; here is an updated version of this patch to reflect the new machine names.
This version includes changes to the update function; for anyone who has tested this patch, note that the machine names for states patch included an 7006. You'll need to make sure that update gets run on your development environment. This patch's update is now 7007 (which may change again before it is committed--it depends what other criticals go in first).
@WorldFallz, @wiifm, other subscribers: please review and let me know how this works.
Comment #35
WorldFallz commentedsorry... the project for which I was working on this ended up going a different way. I will definitely test out the new functionality and report back.
Comment #36
Rix-1 commentedFantastic - now a newbie question: how to I install a patch? (blush)
Comment #37
becw commented@Rix -- if you are checking out the project using git, there are sketchy patching instructions under "Applying a patch" in the handbook page on making a Drupal patch with git.
Comment #38
becw commentedHey Steve, will you review this during the sprint so we can move it forward?
Comment #39
becw commentedSteve, this patch should also resolve #1209824: Order/default of moderation states in drop down when multiple states are present - Usability.
Comment #40
stevectorThis still seems good to go. I had to update the patch slightly to fit with commits since the last patch.
Comment #41
stevectorComment #42
becw commentedThanks! Committed in b12a94.