Site configuration:

* english plus 3 more languages
* a series of book pages in 2 books in english
* a few book pages in other languages

Problem

node/add/book times out

Reason

book_tree_recurse() comes back late or never. Culprit is a very long result from the query in book_toc():

SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.status = 1 ORDER BY b.weight, n.title

The query is rewritten by i18n and it seems that book_tree_recurse() can't handle the result of it.

I didn't go deeper into this, because I think there is a more fundamental conceptual problem here: while 'preferred' mode makes sense for views of nodes or similar, it doesn't make sense within a book. A user shouldn't be able to ever attach a book page of the current language to another language.

I'll be right back with a first shot at a patch for this.

CommentFileSizeAuthor
#1 337431_book_preferred.patch409 bytesalex_b

Comments

alex_b’s picture

Status: Active » Needs review
StatusFileSize
new409 bytes

This patch essentially excludes all book queries. That's a pretty rough approach but I think it might work. Please have a look whether the _way_ I excluded book queries here makes sense at all.

As to whether we can exclude them wholesale, that's a hard question. Maybe I need just poke around and see whether this breaks other parts of the site :-)

I rolled the patch with svn diff out of laziness, should be applicable though.

alex_b’s picture

Assigned: alex_b » Unassigned
jose reyero’s picture