Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When using the Core content moderation module on a Media bundle which is create-able via the Entity Browser IEF widget, the following error is thrown:
Fatal error: Call to undefined method Drupal\entity_browser\Form\EntityBrowserForm::getEntity() in /.../docroot/core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php on line 219
Relatively tricky issue as the form itself isn't a ContentEntityForm, and the there could potentially be multiple IEF widgets attached.
Comment | File | Size | Author |
---|---|---|---|
#6 | entity_browser-undefined_method_getentity-2831018-6.patch | 3.32 KB | validoll |
Comments
Comment #2
imen ch CreditAttribution: imen ch commentedI have the same error when i use content_moderate with RNG module..
Fatal error: Call to undefined method Drupal\rng\Form\EventSettingsForm::getEntity() in C:\xampp\htdocs\drupal2\core\modules\content_moderation\src\Plugin\Field\FieldWidget\ModerationStateWidget.php on line 219
Comment #3
a-fro CreditAttribution: a-fro commentedThis is an issue with the paragraphs module as well. See issue 2848259.
When targeting a single paragraphs bundle with the ief widget, it mostly works (with bugs). However, if you are targeting an entity that has a paragraphs field, this error is triggered.
Comment #4
a-fro CreditAttribution: a-fro commentedComment #5
rutiolmaSame problem using workbench moderation
Comment #6
validollFaced with same issue when use options field.
Fixed it via patch. (for 1.3)
Comment #8
bas123 CreditAttribution: bas123 as a volunteer commentedI am tryng to configure Moderation for my site. Drupal 8.4.2
I installed the various (latest) Workbench and Moderation Modules and found it wasn't fully configured.
In going through the helpful videos (Created for Drupal v7.x) I got to the stage where you enable moderation on the content type you are working with
While adding a moderation state for Posts:
I got to the screen:
Home/Administration/Structure/Content types/Post
-----------------------
Which has the following:
Enable moderation states.
Content of this type must transition through moderation states in order to be published.
Allowed moderation states (Unpublished)
- Archived
- Draft
- Needs Review
The allowed unpublished moderation states this content-type can be assigned.
Allowed moderation states (Published)
- Published
The allowed published moderation states this content-type can be assigned.
Default moderation state
- Draft
Select the moderation state for new content
[Save] Delete
----------------------------
I clicked on the "Save" Button
and this fatal error resulted:
Fatal error: Call to undefined method Drupal\content_moderation\Entity\Handler\NodeModerationHandler::onBundleModerationConfigurationFormSubmit() in /home/MYSITE/dev/site/modules/workbench_moderation/src/Form/BundleModerationConfigurationForm.php on line 184
Any thoughts?
Comment #9
samuel.mortensonComment #10
marcoscanoMaybe the best next step here would be to have clear steps to reproduce.
I've just done this:
- Core 8.6.x-dev
- Enable
-dev
versions of: entity_browser, content_moderation, paragraphs, inline_entity_form, ctools, entity_browser_entity_form (and their dependencies)- Create a paragraph type with a text field
- Add a paragraph field to the Page content type
- Create an EB with the following config: Modal, Tabs, No selection. Add a IEF widget to create nodes of type Page
- Add an entity reference field to Articles, pointing to Pages. Set its widget as EB, select the browser created before
- Enable both Articles and Pages as moderatable content
- Open the node Article form, then open the EB widget to create a Page. Save the page inside the modal.
- Boom
However, the error I get is a different one:
Which makes me wonder if this may have been fixed in the latest versions, and the only remaining bug is #2901390: Integrity constraint violation: 1048 Column 'langcode' cannot be null, which is a paragraphs one?
Or maybe I'm testing it wrong? Let me know if that's the case.
Thanks!
Comment #11
a-fro CreditAttribution: a-fro commentedConfirmed. I just reproduced the same error locally, which the paragraphs patch mentioned above fixes. It appears this issue has been resolved.
Comment #12
marcoscanoGreat, thanks for testing @a-fro!
Closing this for now then, anyone please feel free to re-open if we have steps to reproduce.