Closed (fixed)
Project:
Book
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2016 at 21:43 UTC
Updated:
15 Oct 2024 at 14:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rbayliss commentedComment #6
bès commentedHere is a version of the patch that allow any content type to have the extra field as long are there are in the "allowed in book outlines" list.
Also I removed the "weight" in the render array, as it will be set later by the display configuration.
Comment #7
bès commentedComment #9
bès commentedComment #16
mindbet commentedUpdating this useful patch to Drupal 9.1
Comment #17
mindbet commentedRevised patch #17.
Many thanks to @quietone for help with this.
Comment #19
anmolgoyal74 commentedI think we need to add field in the entity view display config files.
Not sure if this is the right approach.
Comment #21
anmolgoyal74 commentedUpdated variable name.
Comment #23
abhijith s commentedApplied patch #21 and it works fine.The Book navigation can moved/disabled in the book display after applying this patch.Adding screenshots below.
Before patch;

After patch:

RTBC +1
Comment #25
zebda commentedI have a book with three levels.
It looks like the patch only works on the first level (Book) not on the second level (Issues). I don't see how to change the patch so it also works for other levels. Can anyone help with this?
-- Installed the patch again and it is working now
Comment #26
aaronpinero commentedI applied the patch to a Drupal 9.2 site and it appears to work as advertised. RTBC +1
Comment #27
joachim commentedFeel free to set to RTBC status if you think the patch is ready!
Comment #28
catchShould this be $node_type?
Comment #29
rahulkhandelwal1990 commentedIn this patch replaced $note_type by $node_type as suggested in #21, please verify
Comment #31
tsurvuli commentedThis patch is a life-saver, and works great in 9.2.9. However, when we tried to update to 9.3 it fails to apply.
Is there any chance of an update that will work for 9.3/future versions?
Comment #32
aaronpinero commentedI have discovered the same problem with Drupal 9.3. The patch will not apply. I've looked at the patch and the code in Drupal 9.3 and it seems like the patch should work. Maybe the line numbers in the patch need to be updated?
Comment #33
zebda commentedI don't know what the problem was but I made a new patch with the same code. And this seems to work.
Comment #34
aaronpinero commentedI can confirm that the patch in #33 works with Drupal 9.3
Comment #35
joachim commentedThe patch looks like it's failing Drupal code checks. Looks like simple formatting issues.
Comment #36
murilohp commentedI'll fix the issues, thanks!
Comment #37
murilohp commentedMoving back to needs review to see if it pass.
Thanks!
Comment #39
joachim commentedIt also occurs to me that this is probably going to need some sort of update for existing config, as the changes here only apply for fresh installs.
Comment #40
murilohp commentedDo you have any idea about how to update the configs for this scenario @joachim? Normally on the contrib modules we see the usage of hook_update, but this idea is not applied for the core.
Comment #44
quietone commentedThis extension is being deprecated, see #3376070: [Meta] Tasks to deprecate Book module. It will be removed from core and moved to a contrib project, #3376101: [11.x] [Meta] Tasks to remove Book.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
This issue may be re-opened if it can be considered critical, If unsure, re-open the issue and ask in a comment.
Comment #45
liliplanet commentedThat is just amazing! Thank you for the patch quietone and everyone that contributed.
Comment #46
smustgrave commentedMoving to contrib.
Comment #47
mortona2k commentedThis patch is doing the same thing as https://www.drupal.org/project/book/issues/3183232
Minor differences in book_entity_extra_field_info() label and description.
Close this one?
Comment #48
damienmckennaThis needs to be reworked as a MR for v2.
Comment #49
damienmckennaRerolled.
Comment #51
damienmckennaMR created.
Comment #52
damienmckennaComment #53
mortona2k commentedThis is working.
With the patch, I see Book Navigation in manage display, and moving it around or disabling is working.
One issue I ran into is that if you enable a content type to be added to the book, we need to clear the cache to rerun book_entity_extra_field_info().
Seems like that could be done on submission of the book settings config form.
Comment #54
smustgrave commentedComment #55
mdranove commentedReviewed on drupal 10.3 setup with standard install profile.
Testing steps:
1. Ran drush updb.
2. New book navigation field appeared in default and teaser display modes.
3. Moved around book navigation field, worked as expected.
4. Enabled layout builder.
5. Moved around book navigation field on a book node. Worked as expected.
Moving to RTBC.
Comment #56
smustgrave commentedComment #57
damienmckennaHappy to see this committed, thank you everyone!
That said, do we need a update script to force a cache clear, that way the new hook can be triggered so that the extras field(s) are made visible on appropriate view modes?
It might also be worth enabling the field on the "full" view mode for enabled content types and disabled on other view modes.
Comment #58
smustgrave commentedComment #59
smustgrave commented@damienmckenna normally yes, but there are currently about 3 update hooks already in the next alpha release. For the second part about the view mode made a follow up?
Planning a few more release before marking a stable one.
Comment #60
damienmckennaWill do, thank you for the follow-up!