Getting a fatal error when updating to D6.x on a site that has had the book module enabled in the past, but where it is disabled at the time of the upgrade. The message is:

Call to undefined function book_menu_name() in .... book.install on line 217

I think the problem is that we need to make sure the book module is enabled or included before running that update. I think this is because of the change to update disabled modules.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

I'd rather include this functionality verbatimg there, given that book_menu_name() is this:

function book_menu_name($bid) {
  return 'book-toc-'. $bid;
}

Update functions should rather not depend on API functions.

Gábor Hojtsy’s picture

Status: Active » Needs review
FileSize
790 bytes

Test this please. (There might be other API functions used).

KarenS’s picture

FileSize
687 bytes

OK, that change worked. Patch attached.

KarenS’s picture

Status: Needs review » Reviewed & tested by the community

Cross-posted, but the patches are the same, and I did test it and did not run into any further problems.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Actually, yours would be buggy, as you also replaced $book['bid'] with $book['nid'], so I committed mine. Thanks for testing.

KarenS’s picture

Bah! You're right. Good catch.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

ggevalt’s picture

Version: 6.x-dev » 6.1
Status: Closed (fixed) » Active

Not sure if we are breaking protocol here, but I'd like to reopen this issue because after hours of searching, we have not found a solution.

We have just updated our test site from 5.19 to 6.1 and we have the exact same error when we run update.php. It then aborts the update and, it appears, our book content is missing. We have not drilled down that deeply into the problem; I will update with more specifics OR can someone direct me to more current information on this problem. ie., was this still a problem in 6.1 and we should go with a later version of 6 to make the upgrade with? ie., should we take steps in advance of the upgrade that we did not know about?

THANKS so much.

(And I realize this is near to a forum post, but please forgive. You have this problem listed as a bug in the .dev version so it seems logical that this problem may have persisted in released versions.)

geoff

Gábor Hojtsy’s picture

Version: 6.1 » 6.x-dev
Status: Active » Closed (fixed)

You should definitely update to the 6.x latest version given all the bug and security fixes. This was fixed before 6.0 was released, so it is not related to your issue.