Some token discussion started over here. #1079134: Add triggers when states are entered/exited
I am creating this new issue so that token and trigger work can progress independently. I have started revising the token patches in the trigger issue and will post that work here. So far I am finding tokening more complicated than I first expected due to the amount of similar information WB Moderation adds to a node object.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | wb_moderation_tokens-1159256-4.patch | 5.56 KB | stevector |
| #1 | workbench_moderation_token_support-1159256-1.patch | 0 bytes | stevector |
Comments
Comment #1
stevectorHere's an updated token patch.
Part of the difficulty here is that we can have multiple revision objects inside of $node->workbench_moderation. We also have state information directly on the node in the the form of $node->workbench_moderation_state_current and $node->workbench_moderation_state_new
I've account for those in those patch.
Do we need some kind of smart token that will switch between working off of moderation objects and information $node->workbench_moderation_state_current depending on the context?
Comment #2
Shadlington commentedSubbing
Comment #3
dave reid@stevector: Patch is empty.
Comment #4
stevectorSorry about that. Glad I still had the local branch.
Comment #5
rbishop commentedComment #6
kukle commentedsub
Comment #7
Vandalf commentedsubscribing
Comment #8
binford2k commentedI'm seeing some odd behaviour with this patch. This happens with the current 7.1.1 release and with the -dev snapshot and with the 2.x branch. When you try to edit a new draft and hit save, you're redirected to /node/XX/edit and nothing gets saved. It shows the last revision saved. If you moderate a draft, nothing happens. In either case, nothing shows up in the log.
Comment #9
binford2k commentedHmm. I take it back. After using devel.module to clear the cache all works. I thought the cache was supposed to clear on module un/install?
Comment #10
binford2k commentedDue to (I presume) the redundant node_save() discussed here #1084436: doesn't seem to handle file attachments at all, the content updated rule fires twice. On the first firing,
$node->workbench_moderation_state_currentis set. On the second, it is not.However, when the STATE is changed only, then only the second call occurs, the one where
$node->workbench_moderation_state_currentis NOT set. I am working around it with this snippet:but this is a hacky solution at best.
After adding #1226688: Rules Integration Support then the rule for state transition fires only once. But just like above, when editing a draft,
$node->workbench_moderation_state_currentis set and when changing state, it is not. Ideas?Comment #11
milesw commentedComment #12
acbramley commentedDupe of #2144993