Hi,
I use revisioning and workflow. Additionally, I use a custom module that executes on presave for a specific content type to manipulate taxonomy terms. The settings for a state change from (creation) to approved originally were:
- Publish the most recent pending revision
No issues reported in the watchdog and everything worked fine.
After the upgrade, path aliases stopped working as reported in http://drupal.org/node/1608224. One solution was to include a "Save Post" in the actions for the state change. Hence, I changed the actions to
- Save Post
- Publish the most recent pending revision
However, now I have duplicate entries in the watchdog caused by the custom module that executes on presave. Any idea why this happens and how it can be fixed?
Thanks, J.
Comments
Comment #1
jelo commentedMaybe to clarify: even after the update this only happens when I have both actions "Save Post" and "Publish the most recent pending revision" configured. Without "Save Post", the custom module works fine firing on presave. However, no path alias is created for the node due to the committed changes to revisioning. With "Save Post" I get the path alias, but duplicate content errors on the terms via taxonomy module...
Comment #2
jelo commentedKeeping track of related issues:
Crea reported:
"This is probably problem with hook_nodeapi('update') running twice and Revisioning not checking that. Let me explain.
When one uses stuff like core actions (+Trigger ?) or some modules like Rules or Workflow, hook_nodeapi('update') can run more than once during single request. As I see Revisioning stores data in $node->revision_moderation so that data may be interpreted more than once.
I faced similar problems with Workflow module: when you use same $node object its passed by reference so one needs to clear any $node object modifications that are used to define behavior logics, before you invoke any code that could invoke additional hook_nodeapi('update') runs. See #472966: Implement subsequent runs control (http://drupal.org/node/472966). for example of similar problem."
http://drupal.org/node/536826
And here is one that reports problems with XML Sitemap that I experienced as well after the update:
http://drupal.org/node/309974#comment-2914150
My problem simply went away when I updated XML sitemap to 6.x-2.0-rc1. Nodewords did not throw errors, but executed description and title updates 3 times as well which stopped when updating to Nodewords: D6 Meta Tags 6.x-2.0-alpha1.
Here is another issue where weight of the workflow module seemed to be the culprit.
http://drupal.org/node/482126
Based on all I learned from this post, I managed to get around the issue (although the underlying issue is probably not solved):
- I disabled the workflow options on the node edit form (now state changes can only happen on the separate workflow tab and not at the same time a node edit form is saved)
- I forced all content creators to always go through the draft stage (which does not trigger any workflow changes) => this got rid of the pathauto issues and now creates a path alias for all pages
- I added a condition to my custom module to not execute if arg(2) equals workflow, i.e. a workflow state change was triggered from the workflow tab. Now the module only runs upon "presave" operation when content is saved from the node edit form
Comment #3
rdeboerThanks jelo -- great detective work!
Just wondering what Revisioning can do here -- the symptoms seem to manifest themselves as a result of specific mix of modules....
Comment #4
rdeboerD6 is approaching end of life. Doing maintenance fixes and provided patches only.