Problem/Motivation
I was attempting to try out edit_plus to maybe contribute to it but have been hitting blockers (will raise something there to ask) but started to realise it seems geared for layout builder only, so I attempted to go to manage display to enable layout builder on a node bundle but hit this:
Drupal\Component\Plugin\Exception\ContextException: The entity context is not a valid context. in Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase->getContextDefinition() (line 150 of core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php).
Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase->getContext() (Line: 82)
Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase->getContextValue() (Line: 203)
Drupal\navigation_plus\NavigationPlusUi->deriveEntityFromRoute() (Line: 67)
Steps to reproduce
Set up a content type and enable edit plus without yet having layout builder in place
Attempt to go enable layout builder
Proposed resolution
Only try to get context value from a parameter that is an entity interface
Remaining tasks
MR
User interface changes
No fatal error
API changes
N/A
Data model changes
N/A
Issue fork navigation_plus-3508706
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:
Comments
Comment #3
scott_euser commentedThis at least prevents the fatal error, but I am not sure if I am breaking something else as a result
Comment #4
scott_euser commentedYes the same seems to happen in default Umami install (tried to reproduce your edit_plus demo video) using article content type -> go to manage display.
Comment #5
scott_euser commentedRequires #3508703: Composer.json is invalid for tests to run
Comment #6
tim bozeman commentedHeya Scott!
Thank you for pointing that out. Edit+ should be able to run without Layout builder, but I guess some hidden dependencies may have snuck in over time. I'll have to go through it all with a fine tooth comb one day and sprinkle around a bunch of
if (layoutBuilder.isInstalled)all over.Comment #7
scott_euser commentedThanks for the quick reply; to clarify, in this case (and with default Umami) layout builder is installed, but its not enabled for Article content type. It is enabled for other content types, so just checking if its installed is probably not sufficient, more like installed && enabled for the given entity.
Comment #8
tim bozeman commentedoh, right. Thank you :)
Comment #10
tim bozeman commentedI think we got this one.