Problem/Motivation
#3060985: Layout Builder attempts to builds sections to determine if it is disabled was meant to remove considerable unnecessary in layout builder when it's not enabled for a certain view mode/entity being rendered.
However, the solution there only works when all section storage plugins implement this interface and return appropriately.
In #3418328: Optimise Layout builder EntityViewDisplay I identified that navigation does not, and so as soon as the navigation module is enabled, the previous gains from the linked issue vanish, as we could see in #3560118: In Umami, replace Toolbar with Navigation
The performance test changes here are a straight revert of the changes in the previous issue, this is because they test anonymous users that do not have access to either navigation nor toolbar, so it makes no difference with module is enabled.
To be investigated: Is the problem maybe instead/also that \Drupal\layout_builder\SectionStorageInterface::isApplicable incorrectly always returns TRUE, when it should only be applicable to it's own specific context?
Steps to reproduce
Proposed resolution
Additionally to this, do we want to deprecate not implementing this interface and integrate it into the main one in D13?
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3574461
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3574461-deprecate-not-implementing
changes, plain diff MR !14828
Comments
Comment #3
berdirMoved over the MR from the other issue, this doesn't do the deprecation yet.
Comment #4
berdirI had a look at isApplicable(), that happens later when the (too) expensive context stuff did already run. Pretty confusing to have both, but not much we can do about that.
Comment #5
smustgrave commentedPossible to get a test case around the new trigger_error. Layout builder is so tricky want to make sure that does get seen correctly.
Comment #6
catchWe don't need a test just to check that @trigger_error gets called IMO, there's no actual logic there to test as such.
Comment #7
berdirIt does need a rebase on performance tests though. Was hoping to get this in with a clean revert, that makes it a bit more tedious.
Comment #8
berdirRebased the performance test and adjusted the numbers.
Comment #9
smustgrave commentedSince this doesn't need test coverage LGTM.
Comment #13
catchWell it has test coverage, just not for the trigger_error().
Committed/pushed to main and 11.x, thanks!
Comment #15
quietone commentedTweaked the CR and published.