Currently if taxonomy module enabled service provider fails

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:    [error]
The service "serializer.normalizer.entity_reference_revision_item"
has a dependency on a non-existent service "rest.link_manager". in
/var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:58
Stack trace:
#0
/var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(42):
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processReferences(Array)
#1
/var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(36):
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processDefinition(Object(Symfony\Component\DependencyInjection\Definition))
#2
/var/www/html/vendor/symfony/dependency-injection/Compiler/Compiler.php(104):
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->process(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#3
/var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(590):
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#4 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(1284):
Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#5 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(873):
Drupal\Core\DrupalKernel->compileContainer()
#6 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(797):
Drupal\Core\DrupalKernel->initializeContainer()
#7
/var/www/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(540):
Drupal\Core\DrupalKernel->updateModules(Array, Array)
#8
/var/www/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(191):
Drupal\Core\Extension\ModuleInstaller->updateKernel(Array)
#9
/var/www/html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83):
Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#10 phar:///usr/bin/drush/commands/core/drupal/environment.inc(131):
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array,
true)
#11 phar:///usr/bin/drush/commands/core/drupal/environment.inc(198):
drush_module_install(Array)
#12 phar:///usr/bin/drush/commands/pm/pm.drush.inc(1167):
drush_module_enable(Array)
#13 phar:///usr/bin/drush/includes/command.inc(422):
drush_pm_enable('abilways_defaul...')
#14 phar:///usr/bin/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#15 phar:///usr/bin/drush/includes/command.inc(199):
drush_command('abilways_defaul...')
#16 phar:///usr/bin/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#17 phar:///usr/bin/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#18 phar:///usr/bin/drush/includes/startup.inc(458): drush_main()
#19 phar:///usr/bin/drush/includes/startup.inc(365):
drush_run_main(false, '/', 'Phar detected. ...')
#20 phar:///usr/bin/drush/drush(114): drush_startup(Array)
#21 /usr/bin/drush(10): require('phar:///usr/bin...')
#22 {main}

Comments

andypost created an issue. See original summary.

andypost’s picture

Status: Active » Needs review
StatusFileSize
new3.24 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2867579-core83-2.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new4.98 KB

Fix tests

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

looks good, thanks @andypost

andypost’s picture

btw Sometimes I receive `The database connection is not serializable

debug leads to

$this->cache->set('hal:links:relations', $data, Cache::PERMANENT, ['entity_field_info']);`
`build/core/modules/hal/src/LinkManager/RelationLinkManager.php:141
andypost’s picture

StatusFileSize
new7.34 KB

re-roll

andypost’s picture

StatusFileSize
new8.47 KB

reverted service provider needs fix

andypost’s picture

jmagunia’s picture

When I try to apply the patch from comment #8 and #4 to latest dev, I'm getting a message that says:

fatal: corrupt patch at line 173

The error still appears if the Taxonomy module is disabled.

wengerk’s picture

StatusFileSize
new64.41 KB

@pmagunia It's because you apply the patch using the 8.x-1.0-alpha5 version and the given patch 2867579-core83-8.patch is based on the last commits that is not in the tagged version :D.

I just create a patch for people from the 8.x-1.0-alpha5to the compatible version (21/04/2017 - commit 2c9aad8).

Patch from 8.x-1.0-alpha5 to patched version

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 11: 2867579-core83-9.patch, failed testing.

jmagunia’s picture

@wengerk, thanks for the hint although I'm almost sure I applied to the latest dev (not alpha5).

andypost’s picture

Assigned: Unassigned » larowlan
Status: Needs work » Needs review
StatusFileSize
new8.28 KB

Reroll for current dev
I think better to keep tests compatible at least til 8.4 (may need new postponed issue)

Status: Needs review » Needs work

The last submitted patch, 14: 2867579-core83-14.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new3.28 KB
new8.55 KB

Fix tests

alexpott’s picture

I think you should add a dependency on core >= 8.3.0

alexpott’s picture

I.e. add the following dependency to the .info.yml

  - drupal:system (>= 8.3.x)
andypost’s picture

StatusFileSize
new522 bytes
new8.98 KB

Here's fix for #18 (guess 8.3.1 better)

waspper’s picture

Status: Needs review » Reviewed & tested by the community
larowlan’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/tests/src/Kernel/ExporterIntegrationTest.php
@@ -204,4 +203,22 @@ class ExporterIntegrationTest extends KernelTestBase {
+   * Returns link manager service name.
+   *
+   * Core before 8.3 using rest module defined link manager.
+
+   * @see https://www.drupal.org/node/2830467
+   *
+   * @return \Drupal\hal\LinkManager\LinkManager
+   *   The link manager service.
+   */
+  protected function getLinkManager() {
+    $service = 'hal.link_manager';
+    if (!\Drupal::hasService($service)) {
+      $service = 'rest.link_manager';
+    }
+    return \Drupal::service($service);
+  }

Do we need this now that we're enforcing it via the .info file - I don't think we do?

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new2.32 KB
new8.39 KB

Reverted

alexpott’s picture

+++ b/default_content.info.yml
@@ -6,3 +6,4 @@ core: 8.x
+  - system (>=8.3.1)

I'd be a bit more liberal here - like the composer.json... so
= 8.3.x)

andypost’s picture

StatusFileSize
new261 bytes
new8.39 KB

that's it)

andypost’s picture

andypost’s picture

StatusFileSize
new2.8 KB
new11.08 KB

And fix leftover codestyle issues
I think it's ready for commit and next alpha release should be out

andypost’s picture

StatusFileSize
new374 bytes
new11.07 KB

And finally no reason for system module dependency

larowlan’s picture

Status: Needs review » Reviewed & tested by the community
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

  • larowlan committed 499396e on 8.x-1.x authored by andypost
    Issue #2867579 by andypost, wengerk, alexpott, larowlan, pmagunia,...

Status: Fixed » Closed (fixed)

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