The patch that went in at #273137: Split Navigation to User and Administration menu added several new default/required menus to Drupal, but the patch did not contain any update path. The result is that after updating from Drupal 6 to 7, you currently don't have any kind of navigation menu or links to the "Administer" section or much of anything else.
Probably the new menus need to be created, but left empty by default so as to preserve the existing locations of the menu items from the D6 site? Needs more thought...
| Comment | File | Size | Author |
|---|---|---|---|
| #67 | menus_before_upgrade.png | 127.5 KB | Stevel |
| #67 | menus_after_upgrade.png | 130.06 KB | Stevel |
| #61 | 410636-even-better-code-style.patch | 7.08 KB | Stevel |
| #59 | 410636-better-code-style.patch | 7.07 KB | Stevel |
| #55 | 410636-add-dependencies.patch | 6.23 KB | Stevel |
Comments
Comment #1
c960657 commentedHow does this look? A lot of things happend in #273137: Split Navigation to User and Administration menu, and I'm not sure I captured all relevant changes in the patch.
Comment #2
c960657 commentedComment #3
pwolanin commentedI think this needs a little more work - to me this function looks broken also: http://api.drupal.org/api/function/system_update_7009/7
Comment #5
gábor hojtsyReproducing this problem, it makes it rather hard to do upgrade testing from Drupal 6, which is important to keep patches working for the future upgrade.
Regarding the actual patch: the management and navigation menu blocks are now provided by system module, so I don't see why would we need to create the menus here. They seem to be already there. The issue, is that user-block-1 became system-block-navigation and there is this new system-block-management, which nobody enables. The upgrade path migrates user-block-1 to user-block-navigation, which is not true anymore. So we end up without navigation and management blocks.
Manually enabling both blocks after the upgrade gets me the management menu properly (create content + administer), but gets an empty navigation menu (block is not displaying). I bet the later is due to that I did not have any custom nav links, I just did a fresh Drupal 6.11 install to start the upgrade.
So the patch definitely needs work.
Comment #6
gábor hojtsyIn #511258: Do not enable the management menu by default, we are discussing not enabling the management menu block by default, since toolbar module is already there. Once that is resolved, the upgrade path should do the same.
Comment #7
sun.core commentedI can only guess this is still an issue. Horrible issue.
Comment #8
sun.core commented.
Comment #9
randallknutson commentedThis patch fixes the user navigation block to the system navigation and changes all 5 default system menus to match what happens on menu_install(). I tested it on a fresh install of D6 upgraded to latest D7 HEAD and it properly configured the menus for me.
Comment #11
randallknutson commentedReroll. Still figuring out patching and git.
Comment #12
catchCouldn't this use http://api.drupal.org/api/function/menu_save/7 otherwise looks good.
Comment #13
catchDidn't mean to change status.
Comment #14
randallknutson commentedCould use http://api.drupal.org/api/function/menu_save/7 for the new menu items but couldn't use it for updating the old menus since we are changing the menu_name entry in the database. If it is important I can switch the few inserts to menu_saves but otherwise I'll leave the patch as is.
Comment #15
catchCan't use menu_save() because it's a hook_update_N() anyway, RTBC.
Comment #16
webchickIt's late, so I might be mis-reading this, but won't this obliterate any custom title/description people may have given to the primary links/secondary links/navigation menu?
I'm not sure the upgrade path should be futzing with those...
Comment #17
catchNo I think you're right, we only want the inserts here.
Comment #18
berdirRe-roll with the db_update('menu_custom) calls removed.
Side note, is it a "feature" that you can not rename a system menu in D7? I just saw that while comparing the edit form/description on D6/D7....
Comment #19
berdirUps...
Comment #20
catchComment #21
webchickCommitted to HEAD! Thanks!
Comment #22
David_Rothstein commentedThis will not go well if the D6 site had the menu module uninstalled...
Comment #23
rfayAnd I know that HEAD-to-HEAD is not supported, but I get
when running update.php.
Also, even though this update fails, admin/reports/status still insists that it needs to be done. What is the correct behavior when an update fails? Does it remain "Database updates: Out of date" forever? What's the correct way out of this situation?
Comment #24
catchThe easiest way to prevent that from running is have your own update handler which sets system schema version manually. We may need to add that to head2head.
However I think that's a bug in the patch - if a D6 site happens to have a custom menu with that name, they'll get errors too, so we should do a menu_get_menus() and only create them if they don't already exists instead I think.
Comment #25
rfayI know how to fiddle with the system schema version.... But that doesn't answer the question (perhaps not for this issue): What happens to an end user when an update fails? In D6 (I believe) the update was considered to be "done" even though it failed and was then ignored. In D7 it appears to me that if it fails it's always considered "not done". I think the D7 way is probably better, but we aren't really providing a way for the end user to deal with it.
I should also mention that the failure in #23 is *not* logged to dblog at all, and certainly not with details that would allow it to be debugged. Is that another issue that I should open?EDIT: I see #774882: update.php: errors are not loggedComment #26
catchAhh I see, yeah I think the current behaviour is as good as we'll get on that. In this case the upgrade itself has an error, so it not running should result in a fix, which would then allow it to proceed the next time the user updates their site. If the database being upgraded has corrupted behaviour for some reason, then that'd likely take manual intervention before the update could run, I'm not sure there's much else we can do (apart from getting that logging issue committed).
Comment #27
mikey_p commented@Gabor in #6 and @David in #22:
Upgrading a Drupal 6 site that had the Navigation men block enabled, and finding no management menu is a pretty big issue. I just test the upgrade path and spent a good minute staring* and thinking about what had happened to all my menu links, before remembering the change. Gabor's comment about the toolbar doesn't apply since no upgraded site will get the toolbar enabled either.
* I may have just been in awe of how smoothly the upgrade went.
Comment #28
gábor hojtsyWell, as said, we could at least enable the toolbar module on upgrade. We do this with other modules. A notable exception in the D6 upgrade was the update module, but we chose to not enable that automatically, so people can get informed about the types of details it shares with drupal.org. That does not apply here, so we can just go ahead and enable it in the update.
Comment #29
Stevel commentedHere is a patch that, as Gábor suggested, enables the toolbar on update.
Comment #30
ctmattice1 commentedNice improvement. RTBC for me
Comment #31
yesct commentedsmall patch, code style looks ok.
based on #30, rtbc
59 critical left. Go review some!
Comment #32
catchStill needs work for #24 - D6 sites may have menus with the same name, and the current update in HEAD fails in that case.
Comment #33
pwolanin commentedUser created menus are prefixed, so such a conflict should be rare or non-existent outside of a head2head scenario.
As catch says in IRC - we just need to make sure they exist - if it's a real problem, we can use a merge query instead of the API function to create them.
Comment #34
Stevel commentedAfter discussion on IRC with catch an pwolanin, the D6 sites with the same name are highly unlikely, as custom menus are prefixed with 'menu-', and the head2head case is currently not supported, so that should not pose a problem.
Comment #35
David_Rothstein commentedSee #22...
Comment #36
Stevel commentedI think all the comments from #22 are addressed in this version:
1) The toolbar module is enabled and so the administrator has access to the menus.
2) Check for table existance. If the table does not exist, the module is not installed; The insertion will occur when the module is enabled.
3) Adding the extra functionality to update_fix_d7_block_deltas() was pretty straight forward
4) The function was indeed incorrect (although it was merely a naming error), but should now be corrected.
Other idea: Would the user and management menu need to be enabled by default if the navigation menu was enabled in D6?
Comment #37
int commentedComment #38
mikey_p commentedThis works well, and created the management menu and enabled the toolbar module. No errors on a site with menu module previously installed.
Now it feels really weird for the site to have toolbar on, overlay off, and not using seven theme :(.
Comment #39
David_Rothstein commentedI didn't review carefully but it looks pretty good - however, there is a typo:
Also, are we sure that enabling the toolbar is really the right fix here? Compared to (for example) enabling the Management block and putting it in the same region as the Navigation block - that seems like it would be less intrusive. What if they were previously using admin_menu on their D6 site for example... @sun, any thoughts on that? :)
Plus, if we just enable the toolbar module and don't hand out any permissions, then only user 1 can see it; any other admins will still be lost with no easy access to the admin pages. That seems like it's still a big remaining bug to me.
Comment #40
Stevel commentedI'll reroll a patch to correct the typo after there is a decision which way to go here:
1) Enable the toolbar => need to hand out permissions: same roles as access administration pages? Might conflict with other "toolbars" such as admin_menu
2) Enable the management menu => looks more like the old situation. Could be in the same region as the navigation menu.
Either way, we should probably enable the menu-user block if the navigation block was previously active. Otherwise normal users can't log themselves out without knowing the path.
Also, in what order should the menu blocks show up?
Comment #41
catchI really think as long as the person doing the upgrade can find their way to /admin and /user without knowing the URLs, we shouldn't worry too much about the details of the blocks.
When you upgrade a major Drupal version, there is always configuration to change, blocks are a common part of that. In Drupal 5-6 you were lucky if your menu resembled the Drupal 5 one at all.
Having said that, the management block seems like a much less intrusive change if we have to auto-enable something.
Comment #42
berdir#36: 410636-toolbar-and-22.patch queued for re-testing.
Comment #44
Stevel commentedA new patch that enables the user-menu and management block on the same places navigation is shown.
#22.2 is fixed in #831732: system_update_7053 needs to check for existence of menu_custom table so that is removed from this patch.
Comment #45
Stevel commentedLast patch had some code commented out for testing, but which should be enabled.
edit: I used block_flush_caches because otherwise the user-menu and management block weren't in the block table yet. This could have consequences for other modules who still need to migrate their blocks.
Should the block_flush_caches be replaced by inserting the blocks manually here, or should other modules depend on this update having run already?
Comment #46
aspilicious commented+ * Example:
+ * $moved_deltas = array(
+ * 'user' =>
+ * array(
+ * 'navigation' => 'system',
+ * ),
+ * );
There is an @code tag for code in doxygen.
I think we have to use it in this case.
Comment #47
Stevel commentedReroll with code tags added.
Comment #49
Stevel commentedLast patch had ANSI colors in it
Comment #50
Stevel commentedforgot to change the status
Comment #51
aspilicious commentedSrry that I missed this.
1) line exceeds 80 characters
2) mappign? probably has to be mapping
45 critical left. Go review some!
Comment #52
Stevel commentedRerolled with comments from #51
Comment #53
int commented#52: 410636-fix-comment.patch queued for re-testing.
Comment #55
Stevel commentedAdded update dependency to make sure the renamed the block tables exist.
Comment #56
int commentedadd beta blocker tag
Comment #57
sunFollowing lines after $block_exists... need one more level of indentation.
Missing period. Sentence also reads a bit hard for me, but perhaps it's only me.
What happens if the Navigation menu block is not enabled? Do we expect that people have modules/toolbars like admin_menu installed + upgrading them at the same time? I'd be ok with that, just mentioning the possibility.
Powered by Dreditor.
Comment #58
berdirAlso the db_or() conditions should be placed on separate lines, one indentation level deeper. Or, probably even better, it should be generated once outside the foreach and then be reused.
Something like
Comment #59
Stevel commentedRerolled with comments from sun and Berdir.
I don't think we can't expect people to have modules/toolbars installed, as the upgrade docs say you need to disable all contrib modules/themes before upgrading.
So that only leaves 2 options before the upgrade starts: people having a visible navigation, and people not having visible navigation. Anyway, after the upgrade has ended the navigation visibility will be the same as before. This looks acceptable to me.
Comment #60
sunRTBC afterwards:
Seems like this DBTNG code exists twice ;)
Missing blank line.
50 critical left. Go review some!
Comment #61
Stevel commentedAnother reroll with the comments from #60
Comment #62
sunComment #63
yoroy commentedI would like to see a summary of this. I see lots of patches and reviews but very little info on the actual problem and solution.
Comment #64
Stevel commentedHere are the changes made with this patch:
- includes/update.inc: Allow moving blocks between modules.
- modules/system/system.install:
-- system_update_7004: Move the navigation block from the user to the system module.
-- system_update_7009: Fix the rename of the primary menu variable.
-- system_update_7053: Enable the 'user menu' and 'management' menu blocks on places where the navigation block is shown.
So there are actually three things being fixed in this issue :( Would probably have been better when this patch was splitted up instead of adding everything here.
Comment #65
webchickI think what would be helpful for yoroy (and core committers) are before/after screenshots of the upgrade path with this patch.
Comment #66
sunThere's little to see here. This issue went into different directions before, now we're doing the most simple solution, just ensuring that any previously existing menus and blocks are still displayed (some have been renamed and splitted) after upgrading.
I can't imagine any usability issue derived from this patch, which would require screenshots.
Comment #67
Stevel commentedThx sun for updating the issue title, forgot about it
I've added some screenshots, but there really isn't that much to see here.
Comment #68
dries commentedLooks good, and I agree that there are no UX implications here. Committed to CVS HEAD. Thanks.