Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
book.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2014 at 07:50 UTC
Updated:
8 Dec 2014 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
benjy commentedTest to show the issue.
Comment #3
martin107 commentedI think there maybe a little confusion in testBookApi()
the call to createBookNode() with $parent, in effect, set to NULL means that
will be called...when createBookNode exits $book->save() is called on an already saved node ?
This makes no sense to me
Comment #4
benjy commentedThe bug is that you cannot save a book that already exists?
You're saying that you can't save any node twice? To clarify, this issue would exist even if you made a change to the node as well.
Comment #5
martin107 commentedAh good point
Comment #6
benjy commentedComment #7
berdirWhat is critical about this?
Only fatal errors that can be triggered in the UI are critical, and actually, not even that is mentioned anymore on https://www.drupal.org/node/45111, and it also doesn't fall into any of the categories there?
Comment #8
benjy commentedSure, that's fine by me.
Comment #9
yukare commentedJust a note on this, may help to find a solution:
This works and any change on $node is save.
Comment #10
benjy commentedI'm not sure if this is the right fix, but lets give it a try.
Comment #12
benjy commentedI copied this logic from the form, it's not exactly pretty but it fixes the problem and tests should be green.
Comment #13
chx commentedbook never promised to be pretty. I did try to play with the logic a bit but there isn't a lot you can do (I tried to replace $node->book['original_bid'] = $node->book['bid']; with simply $new = TRUE and adjust $new accordingly) but this fails. This patch works so let's do it.
Comment #14
alexpottI wondered if could we remove the corresponding lines from
book_node_prepare_form(). Yep this is ugly but this is not the worst thing in the Book module.Let's not do a whole Drupal install just to test this. Perhaps we can add this to another test method. How about
testBook()since thatTests book functionality through node interfaces.Comment #15
alexpottFor #14
Comment #16
benjy commentedDone.
Comment #17
benjy commentedMissed the first part of #14, lets see the bot likes this.
Comment #19
benjy commentedInterdiff for #17
Comment #20
benjy commentedRe-roll. Interdiff in #19 is still accurate.
Comment #22
chx commentedOK that's enough of attempting this. #16 is RTBC. It's not the role of this issue to fix book.module.
Comment #23
alexpottThis issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed #16 a27d222 and pushed to 8.0.x. Thanks!