Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
book.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jul 2012 at 16:51 UTC
Updated:
12 May 2017 at 13:51 UTC
Jump to comment: Most recent
Comments
Comment #1
tssarun commentedHi
I too facing same problem. Currently i am using Drupal version 7.15, Once i unpublished book and the subpages become members of the very first book and also book hierarchy also changed. I tested in drupal 8.x-dev, but same issue created. Please check this issue
With regards
tssarun
Comment #2
nod_You'd put "need work" if a patch needed work. Since there is no patch it should stay "active".
Comment #3
nod_Based on the report, should be major.
Comment #4
xjmWe still need to confirm whether this is a duplicate of #26552: Allow users with access to unpublished nodes to create unpublished books. Thanks @nod_ and @tssarun!
Comment #5
hyperlinkedI'm not entirely certain if this issue is identical to #26552, but fixing #26552 should also solve this issue.
This issue (#1688026) specifically refers to top level nodes in a book outline that are unpublished. When the top level node is unpublished, it disappears from the book outline menu, but the usual first menu item on the book outline menu "create new book" is not displayed so when you make any edits to the the top level book node, it gets reassigned against the first book that appears after the "create new book" selection option on the Node Edit form. From this point, the original book item is gone even if you republish the top level book node. The top level node, which was previously a book of its own is now a child node and all of its children are also adopted into the new top level book node parent. If you look at the book table in the database, everything under that book ID is now missing.
At this point, your original hierarchy appears to be irreversibly wrecked, but so long as you don't make any edits to any of your original child nodes, all you need to do to get Drupal back to normal is to republish your original top level node while at the same time selecting "create new book" in the Book outline at the same time. Now, I just said that "create new book" is not an option anymore, but it reappears once your node is assigned against a parent after your first edit. Once you save your node as a new book, it then gets re-created as a top level book node and once it becomes a top level node again, it carries all of its child relationships out from under the incorrect parent. I know this sounds confusing so I'm going to show some steps to reproduce this at the end of this entry.
This will only work if you don't make any edits to the child nodes underneath your original top level node while it's unpublished. Doing so will cause your child nodes to get reassigned against another top level node. If there are no other top level nodes, then the node you're editing will become a top level node itself when you edit it.
The hack to the book module suggested in #26552 works for D7 as well as for D8. In D7, if you comment out one database condition, the unpublished book node does not disappear from the book outline menu from the node edit form and so the relationships aren't broken when you save the form.
In D7, the condition to comment out is located around line 393
Steps to Reproduce
The original Book B hierarchy should be restored now and Child B is back under Book B.
Comment #6
tssarun commentedHi hyperlinked,
I too i agree with you. I too checked by comment the following line in $query->condition('n.status', 1) inside book_get_books(). Now its working fine. Or we need to add 'create new book' or 'Please select' in the drop down menu. If we do this then no need to comment the following condition $query->condition('n.status', 1).
Thanks @hyperlinked and @xjm
With regards
tssarun
Comment #7
tim.plunkettRestoring version.
Comment #8
tssarun commentedHi xjm
I too feel this is related(duplicate) Allow users with administer nodes perm. to create unpublished books. and i created patch for drupal 8 with solves both the issues(1688026,26552). Please check and review it
Thanks Xjm, hyperlinked and nod_
Comment #9
tssarun commentedHi
This issue is related to Allow users with administer nodes perm. to create unpublished books. , so i feel this issue duplicate.....
regards
tssarun
Comment #10
pere orga#26552: Allow users with access to unpublished nodes to create unpublished books is related but not a duplicate.
Comment #11
pere orgaComment #12
marcingy commentedrestoring version
Comment #13
xjmThis issue is a duplicate because the other issue resolves this one as well. Please see #26552: Allow users with access to unpublished nodes to create unpublished books.
Comment #14
skll5l commentedI'm experiencing this issue but the top level book is not available in the Book dropdown after it is republished. The book appears in the book table and its children have it as their bid. I can't add new pages under it though. I'm using Panels so there is not Add child page link outside of the node edit form.