Problem/Motivation
Repeatable: Always
Steps to repeat:
1. Enable Book module
2. Create a new Book page
3. Visit a new created page, see "Add child page" and "Printer-friendly version" on the page
4. Enable Layout builder module (but do not configure it further)
5. Clear the Drupal cache
6. Visit the page from step 3
Expected Results:
"Add child page" and "Printer-friendly version" on the page
Actual Results:
"Add child page" and "Printer-friendly version" are absent
Alternate steps to reproduce:
Create a new Article node
Install Layout Builder (but do not configure it further)
Visit the front page
Expected results:
"Read more" links are available below node teasers
Actual results:
"Read more" links are missing
Proposed resolution
Fix the check in layout_builder_entity_view_alter() to ensure that extra field replacements are needed.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 3007973-extrafields-22-interdiff.txt | 1.86 KB | tim.plunkett |
| #22 | 3007973-extrafields-22.patch | 2.85 KB | tim.plunkett |
| #18 | 3007973-extrafields-18-interdiff.txt | 950 bytes | tim.plunkett |
| #18 | 3007973-extrafields-18.patch | 2.84 KB | tim.plunkett |
| #13 | 3007973-extrafields-13-PASS.patch | 2.67 KB | tim.plunkett |
Comments
Comment #2
tim.plunkettI believe this is due to #3001313: Field blocks in the layout builder do not have view mode suggestions
Leaving postponed instead of closing as a duplicate, for now.
Comment #3
stompersly commentedThis problem also exists in Drupal 8.6.4.
1. Enable Layout builder module
2. "Add child page" and "Printer-friendly version" are absent
I am trying to uninstall layout builder but ran into this issue:
Layout Builder cannot be uninstalled while overrides exist; no easy way to revert all overrides
Comment #4
lukasss commentedI also see this in the comment links.
I think the problem extends to all fields-links.
Comment #5
tim.plunkettOh, I made some very incorrect assumptions about the steps to reproduce. I was enabling Layout Builder for Book nodes, which works fine. The problem is when Layout Builder is NOT enabled.
This is also reproducible without Book module: node teasers have "Read more" links
Here's a fix. The current conditional will always be TRUE when the module is installed, regardless of configuration.
Comment #6
lukasss commentedThe patch doesn't work, causes an error.
I think needed use empty().
Comment #7
lukasss commentedDeleted unnecessary
Comment #8
tim.plunkettWhat error does it cause?
That patch will not work since the array will always contain #cache information and will never be empty
Comment #9
tim.plunkettOh it will be an undefined index error in some cases. Okay, working on this now.
Comment #10
tim.plunkettNeeds the
isset()for sure in 8.6, less important in 8.7 but still worth having.Comment #13
tim.plunkettTest addition conflicted with #2938132: Ship layouts that make sense with Layout Builder's concept of sections.
Interdiff was correct though.
Comment #15
lukasss commented#13 works.
TNX. Good job!
Comment #16
tim.plunkettGlad to hear it. Ready for final review!
Comment #17
bnjmnmAdd comment describing what the conditional is checking
Comment #18
tim.plunkettAhh good point, knowing where that
'_layout_builder'string comes from would be tricky without a comment.Comment #19
bnjmnmReviewed and tested:
- Enabled Layout
Comment #20
tim.plunkettThanks! Update the IS to include the non-book module approach to reproduce.
Comment #21
xjmThis looks like a straight-up bugfix with no disruptions and @stompersly documented that it also exists in 8.6.4, so it should be backported.
Sending for an 8.6.x test run.
Comment #22
tim.plunkettMoving the method higher up in the class so it applies to 8.6 and 8.7
Comment #25
xjmCommitted to 8.7.x and cherry-picked to 8.6.x. Thanks!
I added issue credit for @stompersly since the comment helped me notice it should be backported. :)
Comment #27
ariane commentedIn core version 8.6.9 the patch in #22 dont apply.
I think is due to different line numbers in the file layout_builder.module
Comment #28
lukasss commentedThe patch has already been committed in 8.6.8
https://www.drupal.org/project/drupal/releases/8.6.8