Closed (fixed)
Project:
Workflow post-install
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2010 at 00:16 UTC
Updated:
29 Aug 2013 at 15:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
mineshaftgap commentedHere is a quick try at adding this feature. Note that it changes the URL so that you now have to specify if it is published or unpublished:
/content/set_unpublished_workflow_state/in-review
/content/set_published_workflow_state/live
Comment #2
rdeboerNice one, mineshaftgap!
Comment #3
Tim-Erwin commentedHi!
Maybe I should have looked here before writing the same stuff on my own. Whatever, it's really simple anyways. My version behaves as the present version unless you insert a "published" or "unpublished" in URL. For instance:
/content/set_workflow_state/published/Public
or
/content/set_workflow_state/unpublished/Review
and this still works as before for all nodes regardless their status
/content/set_workflow_state/Review
I like this solution a little better because it doesn't break current behavior and it's programmed simpler.
Regards
Tim
Comment #4
rdeboerThanks Tim!
@mineshaftgap: are you happy with Tim's solution to be included in the next release in preference to your own?
Rik
Comment #5
mineshaftgap commentedAbsolutely! I just needed a quick solution for myself and thought that it could help others.
Comment #6
eriktoyra commentedTested Tim-Erwins patch. It works great for what it says it should handle. However, I think we should clarify that this patch does not solve the situation where pending revisions of a published node is available. The node will be set in "Public" state and the latest revision of the node will be published.
Comment #7
HenryLTV commented#3 patch by Tim-Erwin works, but there's a GOTCHA here. For version 6.x-1.2 it actually works only because the http://drupal.org/node/849734 patch was "effectively" not applied.
You can see how the actual patch differs from what was released from my post on that thread: http://drupal.org/node/849734#comment-3574968
If you apply the 849734 patch manually AS-IS along with #3 patch to version 6.x-1.1, you will get the "Invalid workflow state" error because $state_name will erroneously have the state value passed as an argument to the workflow_create_state_for_stateless_nodes() function, therefore $state_name will never be set to end(arg()). Tim-Erwin's #3 patch for 6.x-1.1 assumes $state_name will always be the last arg().
But #3 patch works with release 6.x-1.2 because of:
So $state_name will always take the end(arg()) value and always ignores the passed-in value. Programmitically speaking 6.x-1.2 doesn't really do anything but allow you to pass in an argument that will get overridden by end(arg()) anyway. Not sure what the reasoning here is unless I'm missing something here.
Bottom line, you must apply #3 to version 6.x-1.2 and not use the 849734 submitted patch because these 2 patches don't work together. Unfortunately you still won't have the ability to call the workflow_create_state_for_stateless_nodes() function from code and pass in an argument. Sorry that I don't have the time to solve that issue since I don't currently require that capability.
Hope this saves someone else the time to sort all this out!
Best,
HenryLTV
Comment #8
rdeboerThanks Henry!
Comment #9
achbed commented