I feel kinda stupid reporting this, since there are already working tests covering this, but it still reliably breaks for me:

- New, clean Drupal installation
- Enable the Book module
- Create two book pages, the second with the first as its parent
- At the second book page, only "Home" appears in the breadcrumb

What's particularly peculiar about this is that right after that I successfully ran the Book tests under that installation, and in the verbose messages the breadcrumbs were correct. (In another install, it's exactly the same.)

Can anyone else reproduce this problem? Or give me a hint what could be wrong?

CommentFileSizeAuthor
#14 book-missing-breadcrumb-943520-13.patch1.34 KBiSampo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Haza’s picture

Confirmed here.
Also run all the book tests without any fail/exception.

drunken monkey’s picture

It gets weirder:

5) On the second book page click "Edit", then "Save".
6) Breadcrumb is displayed correctly.

Same result when selecting the node in admin/content and then doing a "publish selected content" or some other no-op action. It seem that the breadcrumb somehow is only correctly displayed, after the node was saved a second time.
I first thougt that this would, strange as it is, at least explain the thing with the tests passing – but no, it doesn't seem like the node is edited before checking for the breadcrumb, and the bug also appears with Javascript disabled (to have exactly the same workflow as the test bot).

PS: Great, I can't reproduce the bug any more! o_O Now, only on the first view (right after creating the node) the breadcrumb isn't displayed, but after reloading it's there. I didn't update the code and I also checked after reinstalling, but the bug seems gone.

@ Haza: Are you still seeing this?

ygerasimov’s picture

I have the same here. Right after creating second book node breadcrumb is not displayed. But after reloading the page it is displayed correctly. Looks very strange.

Haza’s picture

Ho yes, you're right drunken monkey, it seem's that only the breadcrumb is missing only the first time you see the page. (it's the same for me as you describe)

Really weird, yes.

cyxair’s picture

I'm getting the same behavior : breadcrumbs are not complete on page load, but are correct after browser refresh.

Did anyone find some workaround or patch ?

graytoby’s picture

I'm missing breadcrumbs too, re-saving book page doesn't help. Book only shown link to home page in breadcrumb. I've tried custom breadcrumb module and menu breadcrumb module too, no luck.

Ryan Senese’s picture

I'm having this problem as well. One (stupid) way I devised to temporarily fix it is by making a script to crawl all the pages once a day. I'd rather not have to do that, though...

birdfoot’s picture

Confirm this is the case. I'm currently on Drupal 7.8.

I can be reproduce in this way:
1. Navigate and access one of the nested pages in a book via Book Navigation block
2. Checks that breadcrumbs is showing only "Home"
3. Click on the link (for the currently located page) in Book Navigation block
4. Checks that breadcrumbs is now showing the correct trails

graytoby’s picture

My navigation block doesn't show current page so I can't even reproduce that behavior.

dwalker51’s picture

I also have the same problem, if I click the link for the second time, the proper breadcrumb appears otherwise it just goes and places it under home.

droweski’s picture

I have same behavior on d7.10 as well.

iSampo’s picture

Confirming this bug on the latest dev version.

Breadcrumbs are appearing when viewing the page for a second time.
Also noticed that the breadcrumbs are re-disappearing when clearing all caches. Gonna try to find out what's causing this.

iSampo’s picture

Status: Active » Needs work

So getting back to this:

Book is executing the function menu_set_active_menu_names() at book_page_alter(), so it can alter the menus on page load (since the Book menu isn't a 'real' menu and not listed as an active menu?).

I moved the book_page_alter() function contents into the book_node_view() function and it seems to be working as it should (as well as calling it at hook_init but that doesn't feel right).

Maybe some Book module guru might be able to tell whether or not this might break a thing or two.

I'm more than happy to roll a patch if some other function is a better home for the function contents. Thanks.

iSampo’s picture

Status: Needs work » Needs review
FileSize
1.34 KB

So here's a patch how it would look like.

jaxon77’s picture

Version: 7.x-dev » 7.9

I'm having the same issue. The breadcrumb sometimes shows up and sometimes doesnt. It seems it usually only shows up when I hit page refresh.

haydeniv’s picture

Version: 7.9 » 8.x-dev
Status: Needs review » Needs work

Bugs should be fixed in 8.x then backported to 7.

haydeniv’s picture

Issue tags: +Needs backport to D7

Grr. Forgot to tag.

Chi’s picture

Version: 8.0.x-dev » 7.x-dev
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs backport to D7

I could not reproduce the bug on Drupal 8, so move this back to 7.x.

Leagnus’s picture

On D7.43 if i insert page` (that belongs to book menu hierarchy) url into custom menu block and save this menu,
then the page looses its breadcrumbs.
If i re-save the page – breadcrumbs appear as it should be.

The bug also appears till second refresh of the page
when i enable or disable the menu point using menu poweredit.

The effect touches all of the custom menu pages,
that belong to book menu hierarchy.

Clearing cache after modifying the menu solves the issue.