Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2009 at 20:00 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
filipnest commentedI second this problem. Same set up. They appear as being changed in the content type screen but on the create content screen they are the same as they were before.
Comment #2
swentel commentedThis bug also exists in D7, changing version to fix it first in HEAD and provide backport later, looking for solution now ..
Comment #3
pwolanin commentedthis is the function where they are actually generated: http://api.drupal.org/api/function/system_admin_menu_block/7
Comment #4
swentel commentedOk, after some debugging, *I think* it's going wrong in the menu_link_save function. I tested with a custom content type called 'test' and with title test. I added some dsm in includes/menu.inc just before line 2186
which gives:
If you compare the attributes key in options key, you'll see the difference, however, the array_diff_assoc doesn't see the differences and doesn't update the item.
Should we fix that here or still in the system_admin_menu_block function ?
Comment #5
pwolanin commentedAh, ok - so perhaps this is a problem since we are using nested arrays in terms of how array_diff_assoc() works?
indeed array_diff_assoc() has this on its docs page:
Can you double check in D6? There we don't have this check.
Comment #6
pwolanin commentedok, so I think the code could be fixed like:
This does the comparison after removing from $item all keys that are not present in $existing_item - i.e. what we were trying to achieve with the array diff.
Comment #7
swentel commentedThat indeed fixes the problem. Patch attached for D7.
I can't reproduce it anymore on D6 on a new fresh install though, so no idea what went wrong on my existing installation ...
Comment #8
pwolanin commentedCode looks fine, but the code comment above needs to be changed.
Comment #9
dave reidRedundant parenthesis as well. Should be:
if (!$existing_item || array_intersect_assoc($item, $existing_item) != $existing_item) {Comment #10
swentel commentedWhile this fixes the content type description, it seems to have some sort of side effect. When you create a new node and link it to the menu item, it enters the if statement and runs an update query which shouldn't happen - that is, if I understand the code correctly.
Just add a drupal_set_message($item['title']) inside the if statement and you'll see it gets there throwing a php notice.
Also, with administration menu turned on, it seems that a lot of menu items are updated too sometimes - although this module isn't core (yet), we might have to watch out before commiting this because it might cause a lot of overhead when there are more contribs out there touching the menu module.
* Administration menu
* Run updates
* Flush all caches
* Administration menu
* Cache tables
* Menu
* Page requisites
* Registry
* Theme registry
* Disable developer modules
Comment #11
pwolanin commented@swentel - i don't understand your comment. If you create a new menu link this code must be executed.
Essentially the test is:
If you compare to D6, we currently don't have this check at all. Hence, the performance cannot be any worse in D7.
Comment #12
pwolanin commentedcode for review.
Comment #13
swentel commentedSmall typo:
The intesect removes the extra keys, allowing a meaningful comparison.
should be
The intersect removes the extra keys, allowing a meaningful comparison.
Comment #14
pwolanin commentedFixed typo. Added a test that fails in the absence of the change to menu.inc.
Comment #15
pwolanin commentedComment #16
catchRead the discussion and the patch, test looks fine. This is ready to go.
Comment #17
dries commentedLooks good. Thanks Peter and swentel.
Comment #18
Andrew Schulman commentedI've just tried to apply this patch to my D6 installation in order to test it, and it won't apply-- source doesn't seem to match up. Is this patch just for D7 then? Will it be backported to D6? I wouldn't say that the priority is very high; just wondering. Thanks, Andrew.
Comment #19
catchComment #20
pwolanin commentedPer comments above, as far as I know this bug is not present in D6 - it was due to the array_diff() optimization.
Comment #21
Andrew Schulman commentedI reported it for Drupal 6.10. I just tested and it's still present in 6.11. Thanks, Andrew.
Comment #22
sbydrupal commentedSame problem with Drupal 6.12. Thanks.
Comment #23
gpk commentedOn the offchance ... in 6.x ... have you tried clearing the menu cache? Simply visiting the admin/build/modules page should do this.
Comment #24
vivianspencer commentedI can also report this problem in 6.12, clearing the cache has no effect
Comment #25
gpk commentedOK, it was a long shot. I actually can't reproduce this in 6.10. The change is immediately reflected at node/add and also on the text that displays when you hover over the relevant menu item in the Create content menu.
Comment #26
sbydrupal commentedThere is a shortcut to solve the issue (for D.12 it works) : Under Menu --> Navigation, when the menu entry corresponding to the node type is edited, the description field shows up correctly on node/add.
Comment #27
BravoGolf commentedI have a similar error for which I logged a bug (#542654: Content Type not matching Add Node or Content Add) but no idea how to resolve.
Comment #28
HS commentedThis is issue exists in D 6.14
Comment #29
HS commentedActually ignore me. The Content Type can be assigned 'descriptions' in multiple locations. One at admin/build/menu when you edit the item and the other when you edit the content type.
Comment #30
albert volkman commentedBackported for 6.x.
Comment #31
xanoRelated to #2029629: Page node/add shows wrong description of node types?