Currently, you can only specify the state name via hitting an URL, it would be nice to have workflow_create_state_for_stateless_nodes() more programming friendly so that others can call that function in their module code.
I have a patch file that does just that for version 6.x-1.1. Hopefully this can help.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | workflow_post_install.zip | 2.37 KB | achbed |
| #7 | workflow_post_install.module.patch | 7.22 KB | achbed |
| workflow_post_install.patch | 756 bytes | Ye |
Comments
Comment #1
rdeboerNice one Ye! Will include.
Comment #2
rdeboerPatch applied. Released ast 6.x-1.2
Comment #4
HenryLTV commentedIs it just me, or did the 6.x-1.2 release not properly remove line 57?
The patch file shows line 57 completely removed. As it stands, because it hasn't been removed, $state_name will never take the argument value.
Please correct me if i'm wrong.
Thanks,
HenryLTV
Comment #5
HenryLTV commentedI've sorted this out. Here's my post that attempts to sort all of this out:
http://drupal.org/node/681932#comment-3575278
Comment #6
aidanlis commentedLine 57 should be removed. Reclassing as a bug report, as the module does not do what it advertises on the front page.
Comment #7
achbed commentedAs noted, the 1.2 patch did not allow for programmatic access to the module code due to a bug on line 57. This patch addresses that issues and a whole lot more.
I've refactored the code quite a bit, moved all hard-coded URLs to constants (for easier changes as needed by end-users), re-worked the API function for consistency, and eliminated all UI calls (like drupal_set_message) from within the API function.
I've also reworked the URLs to utilize the ?destination= parameter in the calling URL if suppled, modified the URL structure handlers to better detect issues with passed URLs, as well as fixed a lot of the feedback messaging to be more helpful.
The attached patch should be applied to an UNMODIFIED 1.2 release. Applying other code fixes first will cause this patch to break.
Hope this helps someone!
Comment #8
rdeboerThat's great achbed!
Can you please also attach the result source. With all the changes you made it's probably easiest to just past that over the top and check it in.
Cheers!
Rik
Comment #9
achbed commentedHappy to! See attached.
Comment #10
achbed commentedoh, and for reference, this is the list of changes I put in my copy of the
readmechangelog6.x-1.3
=======
Added URL redirect after processing (supports destination parameter in URL if given)
Split URL processing and API function into two separate functions
Moved URL references to constants
Better handling of URL errors/input problems
Altered error and status messaging for clarity
Added separate published/unpublished node handling
Comment #11
achbed commented