Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The book navigation provides an "Add child page" link, which passes the parent ID to the node/add/book form via a GET parameter.
Currently this is broken: the parameter is passed correctly, but it looks as though book_link_load(), which calls entity_load('menu_link', $mlid), is not returning everything book_node_prepare() expects.
This results in the book outline not being filled out as expected.
Comment | File | Size | Author |
---|---|---|---|
#12 | book-2012920-10.patch | 1.91 KB | pwolanin |
#8 | book-2012920.patch | 2.03 KB | dawehner |
#8 | interdiff.txt | 807 bytes | dawehner |
#6 | book-2012920.patch | 1.9 KB | dawehner |
#5 | parent_book-2012920-5.patch | 1.96 KB | Ivan Zugec |
Comments
Comment #1
mcjim CreditAttribution: mcjim commentedSpecifically, book_node_prepare() expects bid and access which are both missing from the menu_link object returned by book_link_load().
Previously, book_link_load() did this:
Now it just does this:
Comment #2
mcjim CreditAttribution: mcjim commentedComment #3
mcjim CreditAttribution: mcjim commentedSome sample code, which fixes the issue. Whether it's the right approach is another story.
I'm not yet sure how we're checking menu_link access in D8, so just threw in TRUE for now.
Comment #4
larowlanTagging
Comment #5
Ivan Zugec CreditAttribution: Ivan Zugec commentedHere's an initial working patch and test for the issue.
But it'll be great if someone who knows the menu_link module can help us.
Comment #6
dawehnerThis fix is fine. Here is a quick reroll.
Comment #7
pwolanin CreditAttribution: pwolanin commentedGiven that we are decoupling from menu links, I'm not sure the change is right here. In any case, the bug seems to be that the access check wasn't run or failed?
Comment #8
dawehnerPwolanin mentioned that the access call was dropped, let's replace that by a direct entity access call.
Comment #10
pwolanin CreditAttribution: pwolanin commentedThat overwrote the $node variable. how about this instead?
Comment #11
pwolanin CreditAttribution: pwolanin commentedneeds to test
Comment #12
pwolanin CreditAttribution: pwolanin commentedre-posting. to get it tested.
Comment #15
mcjim CreditAttribution: mcjim commentedClosing as duplicate of #2183779: Adding a child book page does not automatically select the parent book page in the Book outline vertical tab