Closed (fixed)
Project:
Revisioning
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
23 Jul 2012 at 18:57 UTC
Updated:
3 May 2017 at 16:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rdeboerHi JEmbry,
When you say "publish a node" do you mean "publish the latest revision in favour of the current published revision" or "publish a not yet published node"? In the latter case are we talking about the latest and current revision being published (for instance a node with a single revision) ?
Rik
Comment #2
JEmbry commentedYes, when publishing the latest revision over the current published revision, the node has multiple revisions.
Comment #3
erarcham commentedHello,
This bug is still active in this newest release, I was wondering if this is still being investigated?
Comment #4
pbz1912 commentedI fixed this in the same way that paths and pathauto is fixed.
Comment #5
rdeboerThanks for the path pbz1912!
Rik
Comment #6
rdeboerPatch applied with attribution.
Available in 7.x-1.x-dev
Thanks Laura.
Comment #7.0
(not verified) commentedSpacing issues
Comment #8
lwalley commentedUsing a combination of pathauto and pathauto persist modules with menu-link token patterns results in the generation of an incorrect alias if menu item is removed from the node, as is the case with this patch in comment #4.
At the moment _revisioning_publish_revision() only prevents the update of path alias if pathauto is not set. Pathauto persist module sets pathauto on entity load, and if it sets pathauto to 1 then pathauto module will go ahead and create the alias. If the alias includes menu item tokens in its pattern and the menu item has been removed then the new alias will be missing those bits.
So, what is the best approach for dealing with this? Given this patch prevents menu item from being updated on publish and code exists to prevent path alias from being updated on publish, is it safe to assume that the best approach is to also prevent path alias from being updated on publish when pathauto persist is in the mix, i.e. always set pathauto to FALSE here regardless of what its persistent setting is?
Many thanks in advance for any thoughts on this.
On a separate note, I notice in the patch in comment #4 #1698024-4: Publishing or reverting node that is in menu that there are two if statements that appear to be the same but one sets menu to an array and the other to an empty string, and I was wondering what the intention was behind the second one? Patch code added below for reference:
Comment #9
lwalley commentedRemoving the patch in #4 from the revisioning module appears to address the broken menu tokens in the path alias which I described in my previous comment. I tried unsetting the path to prevent the alias from being recreated but unfortunately that breaks pathauto persist; pathauto persist saves the value of path['pathauto'] in pathauto_persist_node_update() so setting it to FALSE to avoid the alias creation is not an option.
In my use case, after I removed the patch, I was unable to recreate the problem of the disappearing parent menu item described in this issue. In my case the menu item was not set. If I set the menu item on the node in the pre publish hook then the menu item would disappear as described in this issue. I could not find any negative impact when the menu item was not set, alias tokens continued to work correctly presumably because token_node_menu_link_load() kicks in when menu is not set.
So, rather than setting menu to an array of empty values as done in the patch in #4, I instead replaced that patch with a simple unset($node_revision->menu), see attached patch. This appears to do the trick so far, I will continue testing.
Comment #10
cornelyus commentedI wanna make bump on this case.
I have same issue as lwalley, and had to use is patch.
Because of the code on revisioning_api, I am losing the path alias generated, because $node_revision->menu is set to empty. He won't find the tokens necessary.
Comment #11
chris burge commentedThe patch committed in #4 is causing issues in my set up (when used in conjunction with OG Menu Single, the menu item weight gets reset to 0'). It can't work as it was intended to because the 'if' condition and the 'elseif' condition are identical. I don't understand that need to set empty values in the menu array. I think the approach taken in #9 is better.