Closed (fixed)
Project:
Revisioning
Version:
6.x-2.7
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2009 at 18:01 UTC
Updated:
17 Jun 2011 at 06:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
rdeboerHi Daniel,
Thanks for reporting this.
Bit puzzled about this one...
Can you say anything about the conditions under which this "sometimes" happens?
Rik
Comment #2
dboulet commentedI'll have to investigate further to find the conditions under which this happens. Am I the only one having this issue?
Comment #3
crea commentedHmmmmm, first guess:
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: Avoid execute_transition twice (when using Rules, Actions) for example of similar problem.
In short, do you use actions or Rules/Workflow module ? If you have any action that updates the node (and triggering Workflow state change does that) that is probably the case. Try disabling that action to see if it solves the problem.
Comment #4
dboulet commentedYes, I think you're exactly right crea, I have triggers that work with Workflow states to publish nodes. I guess this isn't really a bug with Revisioning then—it only displays the message twice because the node is essentially updated twice.
Comment #5
crea commentedThis *is* bug with Revisioning. When using hook_nodeapi('update') developer should by default accept the fact it may be run more than once.
Not only double messages are ugly, but also second message doesn't make any sense since it's programmed run without human invervention.
Comment #6
crea commentedFind this line:
and change to:
I think it should fix the problem.
Comment #7
rdeboerGood one!
I had forgotten about that repeat-suppression parameter on drupal_set_message(....);
Comment #8
dboulet commentedThanks crea, I never even realized that the parameter existed!
Here's a proper patch to help people test.
Are there any other messages that would require repetition suppression? I had only noticed the one.
Comment #9
rdeboerThanks crea, dboulet. It's in the dev snap shot.
Comment #10
rdeboerComment #12
markabur commentedSomething on my site is firing 'alter' twice, and I'm seeing similar repeated messages, e.g. "Displaying current, published revision of...". Patch attached adds FALSE as above.
Comment #13
rdeboer