After playing with release 4.1.0 for a while, I decided to install the nightly build from yesterday (16 Apr 2003) from CVS. After deleting all the old files and recreating the database, I moved all the core files to the server. The first thing I noticed was the change in the url. What used to be http://localhost/admin.php is now http://localhost/?q=admin. Is there an explanation for the change somewhere I missed in my search?

Also, When I go the admin page, all I got was a "main" div with System Messages and a "menu" div with a link back to index.php.

While I am new to php, I do understand that the CVS version is not stable. I tried to understand the code. I worked my way from admin.php, to common.inc, back to menu.inc. I then searched drupal.org on "menu.inc" and found nothing. I went to list.drupal.org and searched on "menu.inc" in development and got 149 returns. After a 15 minutes scan, I gave up and went to the drupal_devel link of the improved mail archive list on drupal.kollm.org and searched again on "menu.inc". This time 49 results, and number 22 was what I was looking for. Here is a link to the start of the thread.

Since I didn't take the time figure out how to apply a patch, I manually updated the code. It now works. Thanks to Gary Lawerence Murphy.

Couple more things.
1) Search from drupal.org doesn't work well for me. Search at list.drupal.org is better, but I really like Ax's search at drupal.kollm.org. It is more functional and easier to get where I am going. I saw a feature request earlier to update drupal search to use MHonArc here, but it seems closed. Just the ability to sort the search is a big help. Maybe I'll create a new one to get it looked at again.
2) Please include the patch to menu.inc in cvs.

Sorry for the long post. Drupal rocks.

Comments

Dries’s picture

The admin menu works just fine on both drupal.org (yes, we run Drupal CVS) and my development machine without the patch. That is, not everyone can reproduce the problem.

Could you provide an ordered list of each module invoked by module_invoke_all()? Normally, this order should not matter but it is worth inspecting nonetheless.

Here is my chronological list, obtained by putting a print statement in module_invoke_all(): profile, project, search, statistics, story, system, taxonomy, tracker, user, watchdog, admin, archive, block, blog, bloggerapi, book, cloud, comment, drupal, forum, help, jabber, mail, node, notify, page, ping, poll. I'm using PHP 4.3.1 on a Gentoo Linux system.

I'll look into Gary's patch shortly but I'd like to be able to reproduce the problem to fully understand it. (I'm still catching up with patches but it should have hit CVS within a day or two.)

mjwall’s picture

I assume you were asking me to put a print statement in module.inc. Here is my code:

// invoke $hook for all appropriate modules:
function module_invoke_all($hook, $a1 = NULL, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
    $return = array();
    foreach (module_list() as $name) {
        $result = module_invoke($name, $hook, $a1, $a2, $a3, $a4);
<b>&nbsp;&nbsp;&nbsp;&nbsp;		// debug for Dries
&nbsp;&nbsp;&nbsp;&nbsp;		print "$name&lt;br/&gt;";</b>
&nbsp;&nbsp;&nbsp;&nbsp;    if (isset($result)) {
&nbsp;&nbsp;&nbsp;&nbsp;      $return = array_merge($return, $result);
&nbsp;&nbsp;&nbsp;&nbsp;    }
&nbsp;&nbsp;  }

It produced the list no less than 9 times on the home page. Here is the list: block, comment, help, node, page, story, system, taxonomy, user, watchdog. I am using php 4.2.2 on Windows 2000. It is a setup from FoxServ, version 3.0 I think.

Hope that is what you wanted. Let me know if it not. Thanks for looking into this.

Dries’s picture

The problem is that the admin module is not in your list. It is not in Joe's list either.

It should be because it adds the "root menu" of the menu tree. Without the root menu, none of the child menus will show up.

So while Gary's patch might make it work, it doesn't solve the real problem.

Instead, try this:

  • Undo Gary's patch and confirm that the problem still exists.
  • Head on to the administration > site configuration > modules page (type http://foo.com/admin/system/modules/ in your browser's address bar) and click Save configuration. This will cause the module list to be regenerated and should hopefully add the admin module. The menus should show up now.

If that works, we should:

  • Discard Gary's patch.
  • For people that upgrade, we should add an entry to update.php to have it regenerate the module table.
  • For people with a fresh install, we should add an entry to database.mysql, database.pgsql and database.mssql to have it add the admin module to the system table.

Takers?

mjwall’s picture

  • First, I undid the patch, but was still getting the admin menu. So I went to the system table and deleted the admin module entry. Then, I got the same menu error.
  • I couldn't get http://foo.com/admin/system/modules/ to give me anything. The first time I typed it in, it executed something in a command prompt and shutdown. Thinking it was my httpd.conf, I played around but never got it work.
  • I dropped all the tables in MySQL. I added the following line after line 560 in database.mysql

    INSERT INTO system VALUES ('modules/admin.module','admin','module','',1);
    

    and ran database.mysql again.

Once I recreated the superuser, I now have the admin menu. I took a look at update.php, but it will take some time for me go through and learn php. I also inserted the following after line 561 in database.pgsql

INSERT INTO system VALUES ('modules/admin.module','admin','module','',1);

but I don't have Postgres to test it. Anyone want to test it?
I didn't see any insert statements in database.mssql, is that an error? I don't have SQLServer to test either.

Thanks for the help.

mjwall’s picture

I took a look at the URL in your post again. After duplicating the menu error by deleting admin from the system table, I typed in
http://foo.com/admin/system/modules/ which didn't work. Instead, I typed in http://foo.com/?q=admin/system/modules and got the module page. Here, admin is listed as required. Clicking on save inserted it back into the system table, so your fix did work.

Dries’s picture

Thanks for the cooperation mjwall. I've just committed the fixes to CVS and marked the bug report as "fixed".

JoeCotellese’s picture

I'm having the same problem. For what it's worth I applied the changes from the thread and things work for me. Here is the results of my module_invoke_all():

block
comment
help
node
page
story
system
taxonomy
user
watchdog
block
comment
help
node
page
story
system
taxonomy
user
watchdog

Would it help getting output from my phpinfo()?

Anonymous’s picture

Not sure this affects you, but just in case...

Conf.php in cvs includes a section that the conf.php in 4.10 does not have:

#
# Base URL:
#
#   The URL of your website's main page.  It is not allowed to have
#   a trailing slash; Drupal will add it for you.
#
$base_url = "http://www.foo.com";