We updated to the latest beta (beta2) and experienced errors while attempting to edit a layout. We would get:
InvalidArgumentException: EntityDisplay entities can only handle fieldable entity types. in Drupal\Core\Entity\EntityDisplayBase->__construct() (line 126 of core/lib/Drupal/Core/Entity/EntityDisplayBase.php).
Please find the attached patch that resolves this by adding a guard to ensure that the entity is fieldable.
After that, we experienced a second issue that I've also provided a patch for. Just adds a guard around $section_storage to ensure that it's not NULL.
Comments
Comment #2
zseguin commentedComment #3
phenaproximaEDIT: Redacted -- investigating this closer, it made more sense.
Comment #4
phenaproximaRefactored this a bit to remove one of the
ifstatements. I also need to add test coverage.Comment #5
phenaproximaRe-titling for clarity.
Comment #6
phenaproximaHere's test coverage which should prove the bug.
Comment #8
phenaproximaThis increases the coverage a bit by trying to edit the default layout in every scenario. It should fail every run of LayoutBuilderIntegrationTest.
Comment #10
phenaproximaA work-in-progress. This is a significant rewrite of most routing-related parts of this module, so let's see how it does.
Comment #12
phenaproximaWhoops, fixed a bad service ID.
Comment #14
phenaproximaThis should fix the failures.
Comment #15
phenaproximaChanged some things, but I'm much happier with this from an API design standpoint. This unifies all contexts under a single namespace while maintaining some namespace separation, which should make things both simpler and more flexible.
Comment #17
phenaproximaWhoops, forgot to change a context mapping in a test.
Comment #18
phenaproximaLet's test against the 4.x HEAD of Page Manager, and ensure that we conflict with 8.x-4.0-beta5 or older.
Comment #19
phenaproximaAdded a requirements check so that site admins are warned about a (temporary) incompatibility with Page Manager.
Comment #21
phenaproximaOK -- I'm pretty happy with this change, and I'd rather not spend much more time iterating on it. Avanti! Committed and pushed to 8.x-1.x.