- Merge request !1041Added a check to verify if the form object AiContentSuggestionsFormAlter → (Open) created by Unnamed author
Error: Call to undefined method Drupal\layout_builder\Form\AddBlockForm::getEntity() in Drupal\ai_content_suggestions\AiContentSuggestionsFormAlter->alter() (Zeile 40 in /mnt/www/html/syngentacpd901dev/docroot/modules/contrib/ai/modules/ai_content_suggestions/src/AiContentSuggestionsFormAlter.php).
1. Create landing page
2. Add CTA blocks on that page
The error occurs because the code assumes all form objects have the getEntity() method, but AddBlockForm from Layout Builder doesn't.
1. Added a check to verify if the form object implements ContentEntityFormInterface
2. Skip the current iteration if it's not a content entity form
3. Added proper type checking before calling getEntity()
Active
Code
Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.