The modul token prevents in the layout builder to add a new section with display suites layouts. I tested it also on a new installation with the newest versions, got the same problem.
Steps to replicate:
- Download latest Drupal 8
- Install token and Display Suite
- Enable Layout builder on content type
- Use "One column layout",
The browser inspects shows
AjaxError:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /layout_builder/configure/section/overrides/node.1/1/ds_1col
StatusText: OK
ResponseText: Error: Call to undefined method Drupal\layout_builder\Form\ConfigureSectionForm::getEntity() in Drupal\ds\Plugin\DsLayout->buildConfigurationForm() (line 127 of /Users/..../Sites/ww-tuts/bs-build-sites/d-bs-build/web/modules/contrib/ds/src/Plugin/DsLayout.php).
As soon as the module token is uninstalled, it is working again.
Debugging:
The issue seems to be here, https://git.drupalcode.org/project/ds/-/blob/8.x-3.x/src/Plugin/DsLayout...
Comment | File | Size | Author |
---|---|---|---|
#13 | 3137198-13.patch | 934 bytes | swentel |
#9 | 3137198-9.patch | 877 bytes | swentel |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedbksolo created an issue. See original summary.
Comment #2
BerdirCheck your logs for the actual error message.
Comment #3
Ivan Zugec CreditAttribution: Ivan Zugec at WebWash commentedHere's the fatal error:
Error: Call to undefined method Drupal\layout_builder\Form\ConfigureSectionForm::getEntity() in Drupal\ds\Plugin\DsLayout->buildConfigurationForm() (line 127 of ..../bs-build-sites/d-bs-build/web/modules/contrib/ds/src/Plugin/DsLayout.php)
It's this line: https://git.drupalcode.org/project/ds/-/blob/8.x-3.x/src/Plugin/DsLayout... and it's wrapped with
if (\Drupal::moduleHandler()->moduleExists('token')) {
I'm thinking it's a Display Suite issue.
Comment #4
Ivan Zugec CreditAttribution: Ivan Zugec at WebWash commentedComment #5
Ivan Zugec CreditAttribution: Ivan Zugec at WebWash commentedComment #6
Ivan Zugec CreditAttribution: Ivan Zugec at WebWash commentedComment #7
Ivan Zugec CreditAttribution: Ivan Zugec at WebWash commentedComment #8
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedComment #9
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedI would actually say it's critical :)
Attached patch fixes it, could be good to have at least one confirmation, then I can commit and push a new release because this one is tricky to figure out.
Comment #10
ropet CreditAttribution: ropet as a volunteer commentedHey Swentel,
This patch worked for me. Thanks for it :)
Comment #11
BerdirYou could maybe check the form object against \Drupal\Core\Entity\EntityFormInterface instead of the getEntity() call. That might actually exist but return something unexpected, who knows?
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedThis patch worked for me, even I get the following error Undefined method 'getEntity'.
{
"resource": "/e:/drupal/drupaltest/web/modules/contrib/ds/src/Plugin/DsLayout.php",
"owner": "_generated_diagnostic_collection_name_#2",
"code": "1013",
"severity": 8,
"message": "Undefined method 'getEntity'.",
"source": "intelephense",
"startLineNumber": 131,
"startColumn": 145,
"endLineNumber": 131,
"endColumn": 154
}
I'm using Visual Studio Code as the editor.
Thanks
Comment #13
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commented@berdir - yes, ten times more elegant, thanks for the hint!
Comment #15
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedcommitted and pushed, thanks!