Problem

I get error when I try to quick edit referenced custom blocks that are using complex inline entity form.
Is there some workaround for this? It's working with Inline entity form - Simple, but I need Complex because Complex is used when we can reference multiple custom bock types.

Replicate steps

1. Install Inline Entity Form module.
2. Create custom content type
3. Create Entity Reference field to reference some custom blocks
4. Manage form display and change widget to Inline entity form - Complex
5. Create test node
6. Go to node page, click on quick edit icon and try to edit custom block that is referenced.

Image with error attached.
Recent log message:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "content_translation.manager". in Drupal\Component\DependencyInjection\Container->get() (line 157 of E:\Work\TestProjects\d8testit\core\lib\Drupal\Component\DependencyInjection\Container.php).

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

blastoise created an issue. See original summary.

wim leers’s picture

Project: Drupal core » Inline Entity Form
Version: 8.2.x-dev » 8.x-1.x-dev
Component: quickedit.module » Code
thomas.frobieter’s picture

Yes we can confirm this problem still exist. It doesn't only exist for blocks, it also exists for other referenced entities and custom / ECK entities. The best would be to jump "one level lower" and inline edit like you would if you'd open that entity directly with its fields.

frob’s picture

Still an issue, however if translations are enabled on the site then the config_translation content_translation and local modules are enabled the IEF form widget will display (though it cannot be used) and the log will have this error.

Warning: assert(): The container was serialized. failed in Drupal\Core\DependencyInjection\Container->__sleep() (line 28 of /var/www/fremont-mlc.local.ciservers.net/web/public/core/lib/Drupal/Core/DependencyInjection/Container.php)

pq’s picture

Status: Active » Needs review
StatusFileSize
new1.33 KB

Attached a patch that checks whether content_translation is enabled and if not returns FALSE from InlineEntityFormBase->isTranslating().

neeravbm’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new81.76 KB

The patch does resolve the error. Here are the steps I took to test the patch:

  1. Before installing the patch, when trying to QuickEdit the referenced entity, I was getting the error 'Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "content_translation.manager"." at /Users/neeravbm/Sites/ief/web/core/lib/Drupal/Component/DependencyInjection/Container.php line 153'.
  2. I installed the patch using Composer.
  3. Now I am able to QuickEdit the referenced entity.
    Quick edit working
chris matthews’s picture

oknate’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

#2974544: Convert tests from Simpletest to FunctionalJavascript is in, this is unblocked.

#5 introduces some new services into the widget:

+    if (\Drupal::service('module_handler')->moduleExists('content_translation')) {
+      if (TranslationHelper::isTranslating($form_state)) {
+        $translation_manager = \Drupal::service('content_translation.manager');

'module_handler' and 'content_translation.manager' need to be added to the constructor. Also, this should have test coverage.

mjpa’s picture

StatusFileSize
new894 bytes

Different approach, just check the service exists rather than the module. No new services introduced then. The content_translation.manager service can't really go in the constructor as the classes can't be used if the module doesn't exist.

mjpa’s picture

Status: Needs work » Needs review
podarok’s picture

Priority: Normal » Minor
Status: Needs review » Needs work

#9

git apply ief_complex_quick_edit_error-2855627-9.patch 
error: patch failed: src/Plugin/Field/FieldWidget/InlineEntityFormBase.php:438
error: src/Plugin/Field/FieldWidget/InlineEntityFormBase.php: patch does not apply

Also, quickedit deprecated, so probably we can just drop this

shivam_tiwari made their first commit to this issue’s fork.

shivam_tiwari’s picture

Status: Needs work » Needs review
podarok’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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