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

Command icon 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

scott_euser created an issue. See original summary.

scott_euser’s picture

Status: Active » Needs review

This at least prevents the fatal error, but I am not sure if I am breaking something else as a result

scott_euser’s picture

Yes 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.

scott_euser’s picture

Requires #3508703: Composer.json is invalid for tests to run

tim bozeman’s picture

Heya 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.

scott_euser’s picture

Thanks 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.

tim bozeman’s picture

oh, right. Thank you :)

  • tim bozeman committed e5341e9a on 1.0.x
    Issue #3508706 by scott_euser, tim bozeman: Fatal error on Manage...
tim bozeman’s picture

Status: Needs review » Fixed

I think we got this one.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.