Yesterday I upgraded from 5.7 to 6.4 and all seemed to go well. I had turned off the only extra module (ThemeSettingsAPI) and set theme to BlueMarine instead of Zen. I deleted everything from my public tree except for non-Drupal directories (I have several subdirs that contain content from a pre-Drupal site, not yet migrated into Drupal). I even deleted a directory 'drupal-5.7' which I was a little worried about, since it was empty and had no idea of its purpose.
I then copied the new 6.4 tree into place. The upgrade reported lots of info about the database, but nothing that looked like a warning. Afterwards there were 2 warnings in the status report -- needed to turn on update notifications (no surprise) and couldn't write to 'files' dir (no surprise, chmod 777, fixed).
One thing that worried me was that although it told me it had successfully detected my old version and would upgrade, it DIDN'T SAY WHAT THE OLD VERSION WAS. How do I know it really had successfully detected the old version? I feel an improvement is needed here -- I'm new to this site, so I hope someone can propose that.
The front page still has my previous recent articles, but the navigation menu has reverted. It now contains only the link to my contact page (unless I'm logged in as admin, in which case there's also all the standard admin stuff).
What has happened? Have I done something wrong?
It probably won't take more than an hour to set up the navigation menu afresh, but I'm worried about what this implies about the state of the database.
By the way, I've looked back over several weeks of forum listings, haven't seen anything related. But if there has been, apologies for wasting your time.
Comments
A couple things to try: -
A couple things to try:
- Enable the themesettingsapi module (the new version) and run update.php again.
- Go to /admin/settings/performance and "Clear cached data"
Thx for the quick reply. I
Thx for the quick reply. I can't see a themesettingsapi module. I thought it was standard in 6? But admin/build/modules doesn't list it, has it changed its name or is it perhaps always enabled?
Tried clearing cached data, but it made no difference. Can't say I expected it to -- all performance options are disabled except compression.
Other ideas? Shall I have a look in the database (mysql) and see where the menu info is stored? Has this changed since 5.7?
The
The http://drupal.org/project/themesettingsapi module is not a core module. You should install the new version in sites/default/modules, enable it,and run update.php again.
The "Clear cached data" in admin/settings/performance in Drupal 6 rebuilds the menu, among other things.
If your menu is actually in a block, make sure that you have that block configured to appear in a region of the theme you are using. Blocks are configured per theme, because for example a theme may have a left region and another one may have none, or they may have regions with different names.
And some irrelevant information, since you asked:
About version information, each module has an .install file with the same name which contains its database updates with serial numbers. The latest update done for each module is stored in the database in the system table.
When you run update.php the latest update done is automatically compared with the module's available new database updates which will be performed. For "advanced" stuff, update.php has a "Select versions" option where you can see which updates are going to run for each module (although normally you won't want to touch that). Anyway, if you want to see what each of these update serial numbers does, you need to look in the module's .install file.
Why wd themesettingsapi even be relevant while using Bluemarine?
Thanks for clarifying about themesettingsapi, I'll install that. I'd misread "The custom theme settings functionality has been added to Drupal 6!" in http://drupal.org/project/themesettingsapi and supposed it meant it was now within Drupal 6 core.
However, I'd love to know why installing that might make any difference. In 5.7 I installed it when playing around with theme Zen. Before the upgrade I switched back to Bluemarine (which does not use themesettingsapi?). What am I misunderstanding?
I'm too newbie to be sure what a block is, but my navigation menu is in its own column on the left hand side, as with all examples I've seen of Bluemarine. The menu is where I expect and is showing all the admin stuff as before (when I'm logged in as an admin) but it's not showing my own navigation links. It's not as if I've made loads of changes, apart from a brief flirtation with Zen while I was on 5.7, so I'm surprised I'm having this trouble and it's not being reported by loads of others.
I've done a dump of the database before the upgrade and now. Both contain the missing navigation menu items, though 5.7 has a 'menu' table and 6.4 has several tables for menus, and these items are now in table 'menu-links'.
Version info... I didn't mean the version of the optional modules, I meant the version of the whole system. When I ran update.php and it said it would go ahead if I pressed Continue, I would have had a whole lot more confidence it really had detected the old version if it had said "You have Drupal version 5.7 and I'm going to rip your database around so it works for the new Drupal version you've installed, which is 6.4. Are you happy I've detected the right versions?". Wouldn't that be a worthwhile improvement? Or do mistakes with version numbers never ever happen?
The menu system has major
The menu system has major changes in Drupal 6. Did you try the "Clear cached data" button in the admin/settings/performance to rebuild your menu?
About themesettingsapi, you are right, it shouldn't matter with Bluemarine.
Block settings are in the admin/build/block page. There, you can place blocks (navigation, user login etc) in each region of a theme (in the sidebars etc).
- As I mentioned, these settings are separate for each theme, so if you have set Zen to show a block in the right sidebar that won't happen in Bluemarine.
- If you have been using some other additional module for your navigation blocks, for example the dhtml_menu module, you may need to enable it and place the blocks in your theme's regions.
Yes, I did that...
Yes I tried the "Clear cached data" button (as in my reply 17:14 GMT).
I may have changed the login block to appear on the right, certainly haven't changed navigation, I'm a strong believer navigation is most natural on the left (while ack'ing that people have personal taste), so I know I wouldn't have moved it.
What would be really interesting would be a guide to looking at the database tables to understand their interrelationship and thus deduce why some things are and aren't being displayed. But, failing that, I'll continue shotgunning it like a monkey.
Er, a monkey with a shotgun, that is! :)
Tomorrow I'll try exploring the admin menus some more, perhaps there's a setting that could be changed that would reveal these hidden parts of the menu. And I'll install themesettingsapi.
find . -name "*"|xargs grep -l SELECT.*menu_link
find . -name "*"|xargs grep -l SELECT.*menu_link
./includes/install.inc
./includes/menu.inc
./modules/book/book.install
./modules/book/book.module
./modules/menu/menu.admin.inc
./modules/menu/menu.module
./modules/system/system.admin.inc
./modules/system/system.module
I'm guessing includes/menu.inc is the most interesting of those and stands a chance of showing me my problem.
It's quite a lot of code. Any idea where can I go to find an overview of its purpose? Or a better idea of how to troubleshoot it?
You could take a look at
You could take a look at http://api.drupal.org/
There is an entry for the Menu System, and you could also type menu_system in the autocompleting search box to see related functions.
Especially check the http://api.drupal.org/api/function/menu_rebuild/6 function.
Also take a look at the modules/system/system.install file, system_update_6020 and 6021
Also...
http://drupal.org/node/102338 Drupal menu system (Drupal 6.x)
You've been a help Rusty, but what's the form in these forums -- I'm surprised nobody else has piled in with some ideas, is there a convention that once one person starts answering everyone else hangs back?
No, it is just that new
No, it is just that new forum topics come up fast and the older ones scroll down. The reason that I have been replying is that my tracker page shows me any activity in the posts that I have been involved.
You could consider that an issue. Maybe it would help if people could "subscribe" to posts so that they can revisit them later, but that is not possible yet.
See also some additional info that I added to my previous reply almost at the same time that you replied.
How to troubleshoot?
Thanks Rusty, have looked now at 'Recent Posts' and I see what you mean! Anyhow, v glad you've stuck with me.
This evening I'll try to find time to dig some more. Before upgrading I did take a backup of files and mysql (never done that before, no idea if it would restore), so I'm tempted just to go back to 5.7. But I guess that would neither teach me anything nor have any chance of helping if this happens elsewhere.
I don't have a local test system, so no chance of stepping through with a php debugger. I'm thinking of adding some temporary info in the menu.inc code, e.g. echo '
';. Or creating a little fubar.php to grab stuff out of the d/base and display it usefully? All suggestions welcome.
My feeling is that all the menu info is still in the database, but for some reason 6.4 is deciding the current user doesn't have access to most of the old menu entries. Even if it's user/1.
I'd like to understand how one gets from index.php to wherever the navigation block is generated and what calls stuff in menu.inc. Most articles I see are about how to write a theme/module/whatever, but explained as though the rest of Drupal is a black box that works by magic -- create this this and this function to override base behaviour but no indication of what's really going on underneath. I find that very difficult to relate to. Perhaps there's some good overviews of the internals and the code somewhere? But without going into the ultra-detail of the function by function specs in api.drupal?
The "black box magic" is
The "black box magic" is Drupal's hooks system. See api.drupal.org, "Module system (Drupal hooks)".
For example there is a hook_menu() function. Any module can implement this hook by defining its own modulename_menu() function. Then Drupal runs all those modulename_menu() functions automatically.
Even the menu module itself implements this hook, with a menu_menu() function.
About your question, "who calls stuff in menu.inc", go to api.drupal.org, search for menu.inc, click on any of its functions, then go to its "references" tab and you can see who is calling it. Although I guess this is not very useful.
Did you check system_update_6021 to see what changes should have happened to the menu in the database during update?
system_update_6021
I don't know what check system_update_6021 means?
Are we indenting rather a lot, should I add my next remark at the outer level before one of us has to order a wider screen! ;) Though I'm not saying I wouldn't be happy to have such an excuse! ;)
system_update_6021() is a
system_update_6021() is a function in the modules/system/system.install file. It is the one which converts a Drupal 5 menu to Drupal 6, so you may want to see what changes it makes (or tries to make) to the database.
The previous one (update 6020) defines the new database schema for the menu.
theme()
Well, I think I can say those functions have made their changes. Looking at my dumps, the 5.7 database has a table 'menu'. The 6.4 has tables 'menu_custom', 'menu_links' and 'menu_router'.
I've been tinkering with the source. E.g. adding to the start of theme(): print "<!-- " . $hook . " -->";
Quite a busy little func this, eh! E.g. rendering a rather small page I get:
markup textfield form_element textfield form_element textfield form_element value textarea form_element value submit button hidden hidden form
page
blocks item_list textfield form_element password form_element submit button markup hidden hidden form menu_item_link menu_item menu_tree block block blocks blocks blocks blocks breadcrumb help status_messages menu_local_tasks closure
This is actually my Contact page (which explains items such as form, button and various fields.
The calls prior to 'page' are (indirectly) from the earlier code in index.php, building a string $return which contains the raw page with no sideblocks or theming, then there's a final line
print theme('page', $return);
which results in the later calls building blocks and other stuff.
So I think my next port of call is to try to understand menu_tree better.
Still fumbling around...
One of the pages that's really winding me up is http://api.drupal.org/api/group/menu -- it looks like exactly what I currently need to understand. And I'm sure it's fine for anyone who already knows this stuff well enough not to need that page. But for the rest of us it might as well be written in Martian.
"The Drupal menu system drives both the navigation system from a user perspective and the callback system that Drupal uses to respond to URLs passed from the browser." What does that really mean in plain English? It goes on "For this reason, a good understanding of the menu system is fundamental to the creation of complex modules." -- yep, I can certainly relate to that! :/
However, there's also some really fantastically good pages around. I've no idea how I found it, but http://drupal.org/node/10858 is a gem. It's "Drupal's page serving mechanism (4.6)". It's really well written, but... 4.6??? Where's the update for 5? For 6?
How the system maintains menu order
http://drupal.org/node/141866 "How the system maintains menu order" may be relevant, for understanding my navigation menu. I can't figure out whether the menu_links/menu_router tables are faulty, or whether access is why I'm not seeing all the menu I should.