Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Drupal 6.14.
Book module generates book nodes but doesn't link them.
No Book module entries in menu_links table.
Very old (year or more) and very recent (post installation of 6.14) books in book table.
How do I fix this?
Comment | File | Size | Author |
---|---|---|---|
#18 | drupal-5-modules-1.jpg | 82.2 KB | Hetta |
#18 | drupal-5-modules-2.jpg | 90.5 KB | Hetta |
#18 | drupal-5-modules-3.jpg | 79.69 KB | Hetta |
#18 | drupal-6-modules-1.jpg | 158.17 KB | Hetta |
#18 | drupal-6-modules-2.jpg | 128.29 KB | Hetta |
Comments
Comment #1
markpenny CreditAttribution: markpenny commentedComment #2
VM CreditAttribution: VM commentedwhen creating a book page you have to link it to a book/another page using the dropdown toward the bottom of the page. Have you done this?
Drupal.org uses drupal 6 and the documentation area, built on the books module works fine.
Comment #3
VM CreditAttribution: VM commentedcrosspost changed title
Comment #4
markpenny CreditAttribution: markpenny commentedThe dropdown list is there, but it's empty. Once I understood that book.module in 6.x worked differently and used menu_links, I looked in that table for Book module entries and found none. It appears that the module and its partners are not putting data there.
Comment #5
VM CreditAttribution: VM commentedhmm, you should have two options in that drop down.
none and add new book ?
Did you set up the content types that are allowed to be used in administer -> books?
Comment #6
markpenny CreditAttribution: markpenny commentedYeah, I've got none and add new book, but none of my books, even after adding a new one.
Yes, content types enabled.
Comment #7
VM CreditAttribution: VM commentedhmmm. my sandbox is has the lastest -dev of 6.x install and I can't recreate this issue.
I'd suggest, first testing your theory of a bug on a fresh install of 6.14, if the bug is present, test 6.x-dev where it may be fixed already and awaiting a new point release.
Comment #8
markpenny CreditAttribution: markpenny commentedI was thinking about switching to an older version of Book. I suppose I could switch in a later one. Or are there other modules involved, like Menu?
Comment #9
VM CreditAttribution: VM commentedCould be other modules involved. Reviewing the patches that went in and the bugs that were supposed to fied by these patches between 6.14 and the last roll, which I believe was Nov, 16 may prove fruitful.
I'll move this back to bug report for now, but I've no 6.14 to double check. Updating to -dev shouldn't be much of an issue. It's only been bug fixes going in. No API changes and I don't believe there has been a DB changed between 6.14 and what is currently 6.x-dev. If there has been, it's not in my notes.
Comment #10
markpenny CreditAttribution: markpenny commentedI'm not afraid of a new house. It's moving all the furniture that gives me pause. My site is module heavy.
Anyway, thanks for responding.
Comment #11
markpenny CreditAttribution: markpenny commentedThe problem seems to be more menu- than boo-related. Might Simple Menu or Administration Menu somehow interfere? It doesn't seem likely, but I don't know enough about PHP to properly judge.
Comment #12
VM CreditAttribution: VM commentedI'm using admin menu, but not simple menu and don't see this issue. Disable simple menu and test.
Comment #13
markpenny CreditAttribution: markpenny commentedI'll try that. Thanks.
I've just checked menu_link again. No Book items. Also checked book. There are mlids, bids and nids, so it looks like the Book end is working. Looked for the mlids in menu_link. Found none.
Comment #14
markpenny CreditAttribution: markpenny commentedBy fixed I mean that I've gotten close enough to the bottom of the problem to understand what I need to do to get the desired results on my site.
The first problem was that the new menu_links-generating version of Book did not generate menu_links for pre-6.x books (books created before installation of Drupal 6). It added the field "mlid" to the book table and assigned all books an mlid, but it added no records for them to menu_links. Since Books 6.x pulls everything together through menu_links, there were no titles in the Book List (/book), even though there were plenty of nodes of type Book.
The second problem, the one that led me to believe the module wasn't generating new books, was that I forgot that books in the Book List have to be created through Book Outline (or Outline, if you want to skip clicking the Edit tab). That is, a node of content type Book is not automatically added to the Book List. The Book List lists the top-level page in a tree of pages and each top-level page must be designated through Book Outline (or Outline).
The quickest solution for me came in two stages.
This populated the Book List and gave me books to assign pages to.
All done.
Fortunately for me, I only had about thirty or forty nodes to deal with. Sites with larger book and page populations might prefer a slicker, code-based solution.
Hopefully future versions of Book will either make no changes to the database structure of the module or automatically update all instances to the new structure. I had the impression 6.x was supposed to do that, but it didn't in my case. I was not alone.
Comment #16
Thomas_Zahreddin CreditAttribution: Thomas_Zahreddin commentedAfter checking the correct code in book.install
i came to this conclusion:
1.) drop table book in D6 (if there are no diffs to your backup of D5)
2.) reimport table book from D5
3.) run update_6000 for the book module (2nd page of update, Select Version, choose 6000 in the drop-down-box for book)
4.) check your book hirarchy
I'm very irritated that this error comes up after so many (??) D5 updates in the past, another annoying thing is that this error was closed without a solution for a core module!
@core developers: Please rethink your strategy: Either maintaining all (!) core modules or reduce the number of core modules.
Best
Thomas Zahreddin
Comment #17
markpenny CreditAttribution: markpenny commentedI'm sorry other people are still having trouble. My solution has worked swimmingly for me. Granted it's a bit troublesome.
Hopefully this sort of thing won't come up again.
Comment #18
Hetta CreditAttribution: Hetta commentedOK, the book module update script is horribly broken.
I just upgraded from d5.21 to d6.16. A list of d5 and d6 installed modules can be found in the attached screenshots. I don't think they matter ... I think what matters is the number of book nodes vs. the amount of memory allocated to mysql and php.
I did the upgrade by the book: disabled all d5-contributed modules, removed d5 files, unzipped and moved d6 files, ran update.php, added d6-contributed modules, and ran update.php again.
Running the update script netted me about 500 identical errors. They all basically say this:
after those, the next batch of about 500 errors was this:
After the upgrade, the site worked, kind of sort of. However, I
1) had to up the max_allowed_packet limit from 1M to 16M (got error messages that mysql couldn't handle things, on trying to view any node included in a book)
and
2) had to up the memory_limit from 128M to 256M. (php threw "out of memory" errors, yes, with that 128M, so I did the binary thing and doubled the availalbe memory).
It's entirely possible that the book-to-menu-list update is enough of a resource hog that it CANNOT complete ... BUT doesn't throw an error to say so. I don't know. Set things to 1M and 16M (or similar), run the script, and see what happens.
Several of my books were partially (or fully) unlinked. I have no idea why some are still linked while others aren't. ALL of my top-level books had menu entries; some of those books are unlinked (while also orphaning all child nodes), some aren't.
The fix given by Thomas http://drupal.org/node/645214#comment-2454738 works.
Comment #19
HorsePunchKid CreditAttribution: HorsePunchKid commentedThank you, Thomas_Zahreddin; that worked like a charm. Changing version because this is still broken when upgrading from latest D5 to latest D6.
Comment #20
Hetta CreditAttribution: Hetta commentedOf course, you could delete the book-toc-% entries from menu_links first ... if you don't, they'll be double, but your books will work.
Comment #21
WiredEscape CreditAttribution: WiredEscape commentedDrupal 5.22 -> D6.18 has same problem.
With original update the book table is updated but mlid values are not created in menu_link table. There is a gap in menu_link mlid values that match the mlid values created in the book table. Seems like the auto-increment is increased by the number of rows in the book table but rows are not inserted into menu_link table. Almost like it fails part way through the menu_link table update.
Thomas's #16 solution works with no visible problems, but I'm unsure if there will be future problems...
Comment #22
asb CreditAttribution: asb commentedRelated issue: #467770: Book structure disappears repeatedly
Comment #23
fehin CreditAttribution: fehin commentedPost #16 solved the problem for me. Thank you.
Comment #24
sumitk CreditAttribution: sumitk commented#16 helped me! Thanks!
Comment #25
maxudit007 CreditAttribution: maxudit007 commented#16 working in Drupal 6.15 but not in Drupal 6.16. When I followed the Thomas steps, I got this: (So, any fix more than this? Many thanks in Advance.)
book module
Update #6000
* CREATE TABLE {book_temp} ( `nid` INT unsigned NOT NULL DEFAULT 0, `parent` INT NOT NULL DEFAULT 0, `weight` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (nid), INDEX parent (parent) ) /*!40100 DEFAULT CHARACTER SET UTF8 */
* Failed: INSERT INTO {book_temp} (nid, parent, weight) SELECT b.nid, b.parent, b.weight FROM {book} b INNER JOIN {node} n on b.vid = n.vid
* DROP TABLE {book}
* CREATE TABLE {book} ( `mlid` INT unsigned NOT NULL DEFAULT 0, `nid` INT unsigned NOT NULL DEFAULT 0, `bid` INT unsigned NOT NULL DEFAULT 0, PRIMARY KEY (mlid), UNIQUE KEY nid (nid), INDEX bid (bid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */
* Relocated existing book pages.
* DROP TABLE {book_temp}
Comment #26
fehin CreditAttribution: fehin commentedPost #16 worked for me in 6.16.
Comment #27
arithok CreditAttribution: arithok commentedPost #16 worked for me in 6.17, thx.
Comment #28
t3r0 CreditAttribution: t3r0 commentedI had just the same issue when updating a d5 site to d6.. And post #16 fixed the issue for me too!
Comment #29
PMunn CreditAttribution: PMunn commentedI also had this problem coming from 5.x to 6.x on PostgreSQL. I was lazy checking my site and caught this late. Plus my books were small so I used the method described in #14.
This really makes me fearful of what upgrading from 6 to 7 will be like, but at least I've solved the problem for now.
Thanks for all the help on coming up with this solution. Personally I'd have been afraid of doing something like #14 but then again, with database backups one can be bold.
Comment #30
ducdebreme CreditAttribution: ducdebreme commented#16 worked for me when upgrading D5.23 -> D6.17
Comment #31
calebgilbert CreditAttribution: calebgilbert commentedInstructions in comment #16 worked for me as well, thanks!
Comment #32
oadaeh CreditAttribution: oadaeh commentedThose of you who are still having problems with upgrading from D5 to D6 should check out #767408: semaphore table need to be created during update_fix_d6_requirements(). Applying that patch to my D6 installation before running the upgrade.php script fixed my book outline disappearing problem.
Comment #33
ronsnow CreditAttribution: ronsnow commentedJust wanted to add that Thomas_Zahreddin's #16 fixed the problem we encountered on 5.23 -> 6.19 upgrade. Before doing the steps outlined in #16 I had insured that #32's suggestion that the semaphore table exist was also done. In short I dropped the book table, brought that table over from our 5.23 DB and re-ran the update.php with number 6000 being selected for the book-module.
Thanks! It fixed our problem without a lot of data entry/manipulation.
Comment #34
dentonlt CreditAttribution: dentonlt commented#16/Thomas: wow. Today you're my hero.
Another confirmation that this method works for 5.23->6.19. Much savings in time and effort, no need to manually re-create book hierarchy - thanks!
Comment #35
curtzt CreditAttribution: curtzt commentedWhen this piece of the update script shown in #25 failed for my 5.23 site as I was trying to upgrade it to 6.19, it failed because it encountered duplicate entries in the old book table. The actual error I got in the big pink box looked like this:
* user warning: Duplicate entry '5693' for key 'PRIMARY' query: INSERT INTO book_temp (nid, parent, weight) SELECT b.nid, b.parent, b.weight FROM book b INNER JOIN node n on b.vid = n.vid in /home2/olyblogn/public_html/testbed/modules/book/book.install on line 127.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home2/olyblogn/public_html/testbed/modules/book/book.install on line 219.
Naturally, this happened when I tried the solution in #16 too, since the same script was running on the same database tables. (There were actually a couple of kinds of entries with identical nids in my 5.23 book table.)
I think that these duplicates were there all along, and that they just didn't interfere with the display of the books using the simpler database structure for books in 5.x. (However, I didn't have a working 5.23 setup any more by the time I finally worked through my other problems getting from 5.23 to 6.19; I didn't even realize that most of the book links were gone until a few days after I heaved a sigh of relief and thought that I'd finally made it to 6.x. 600 or so entries out of the 2600 that should have been done actually got made in the new book table before things went south, though many of those were screwed up.) So it's conceivable that these duplicates weren't actually in the database when my 5.23 site was working fine, and that the data for that table got corrupted at some stage in my trying to work out other problems in the upgrade.)
Anyway, I finally copied the data out of the sql dump for the book table, put it in a spreadsheet to locate all the duplicate nids, deleted them manually, pasted the remaining data back into the sql dump in the appropriate format, imported that table back into my 6.23 site, and ran the 6000 update according to the advice in #16. I bet there were more elegant ways I might have done this, if I knew more, but it did work.
The potentially useful point for others with book update problems may be that I think you can end up with duplicate nid entries in a book table in 5.x and still not have any difficulty with your books, but any duplicate nid entries in that table will break the upgrade script when you try to go to 6.x.
Comment #36
kenianbei CreditAttribution: kenianbei commentedsubscribe
Comment #37
Marvine CreditAttribution: Marvine commentedAny idea to execute this :
3.) run update_6000 for the book module (2nd page of update, Select Version, choose 6000 in the drop-down-box for book)
with Drush module ?
Thanks.
Comment #38
nvahalik CreditAttribution: nvahalik commented#16 worked well for me as well.
Comment #39
prokopton CreditAttribution: prokopton commentedDoes anyone know the complete mysql command to re-create the "book" table for Drupal 6.19 using the mysql command line?
Thanks.
Comment #40
gemini CreditAttribution: gemini commentedConfirming: solution in comment #16 solved my upgrade issue from 5.23 to 6.19
Comment #41
catya CreditAttribution: catya commentedAnyone know if there was ever a non-manual fix for this? I have way too much content to do this by hand.
Comment #42
ambereyes CreditAttribution: ambereyes commentedSolution in comment #16 solved my upgrade issue from 5.23 to 6.19 as well
Comment #43
VM CreditAttribution: VM commentedThis needs to remain version 6.x-dev if it's ever going to be looked at.
Comment #44
prokopton CreditAttribution: prokopton commentedFor solution #16, can someone please show me the commands to do it?
Thank-you.
Comment #46
ajzz CreditAttribution: ajzz commented#16 Works from CVS DRUPAL-5 to DRUPAL-6-20
@prokopton, note that if you have two databases on your mysql server instance for D5 and D6 (with names mysite_d5 and mysite_d6), the following command will remove the existing book table from the D6 database and copy the one from the D5 database. [As usual, make sure you have full backups of both databases before you start playing around with mysql commands that drop tables.]
Comment #47
prokopton CreditAttribution: prokopton commentedThanks, ajzz.
Comment #48
sara78 CreditAttribution: sara78 commentedHappened to me with Drupal7 too.