Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you call update.php at the moment you fail with a message like
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "plugin.manager.views.display" does not exist. in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 691 of /var/www/d8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).
let's try to reproduce this in a test.
Comment | File | Size | Author |
---|---|---|---|
#10 | views-1783692-9.patch | 2.55 KB | fastangel |
#6 | views-1783692-6.patch | 2.19 KB | fastangel |
#4 | views-1783692-2.patch | 2.72 KB | fastangel |
#1 | views-1783692-1.patch | 2.11 KB | dawehner |
Comments
Comment #1
dawehnerThis just works if you reset the container (i'm not sure whether this is actually the right way to do that).
Comment #3
xjmIf we're going to remove the expected list of the correct plugin types and replace it with View::getPluginTypes(), let's also add a unit test for that method that checks the expected list. Tim filed #1784072: Add a unit test for View::getPluginTypes().
Should add a comment for this (something like "Inject a fresh container for testing to reduce over." or something). Whatever is accurate.
Tests what about the view bundle, precisely? (That it's not broken nor obliterated from the container, but... what specifically? Let's add some detail.)
So the idea here is that the container is getting reset when the cache is flushed. So, let's say something about, "Do not explicitly rebuild the container; instead, use the container built during the cache clear." above the
drupal_container()
call.Let's add a comment and assertion message here. Value true is TRUE isn't the most informative message in the world :) and what we're checking is that the stuff is still available from the container.
Comment #4
fastangel CreditAttribution: fastangel commentedHi,
I attached one patch with test #1784072: Add a unit test for View::getPluginTypes() and other changes:
Drupal\views\ViewExecutable
Is need this change.
ViewExecutable::getPluginTypes();
Now is need call viewExecutable... instead Views.
$this->assertTrue($manager instanceof \Drupal\views\Plugin\Type\PluginManager);
The type of manager now is PluginManager.
Regards.
Comment #5
tim.plunkettThanks for working on this @fastangel!
This should have a comment.
EDIT: This was pointed out in #3, it looks like none of that was addressed.
instanceof respects use statements, you can add that to the top and just have
instanceof PluginManager
#1784072: Add a unit test for View::getPluginTypes() should still happen on its own as this class is not a unit test.
Comment #6
fastangel CreditAttribution: fastangel commentedOk. Attached new patch.
Comment #7
dawehnerMaybe i'm not into that topic/english language, but i don't get what "to reduce over" means here.
I really like this test function, simple as it is.
Comment #8
tim.plunkettThe failure in #4 is #1786990: [Module]Bundle is registered too late in WebTestBase::setUp()
Comment #10
fastangel CreditAttribution: fastangel commentedOk. I attached a new patch. In this new patch I changed the description of drupal_container and fixed testClearCache with the special case join and wizar. I talked with @dawehner__ for find one solution for these cases.
NOTE: Only I get this error in tests
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "plugin.manager.views.access" does not exist. in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 690 of /Users/jacintocapote/Sites/drupal8/drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).
Comment #12
fastangel CreditAttribution: fastangel commented#10: views-1783692-9.patch queued for re-testing.
Comment #14
tim.plunkett#10: views-1783692-9.patch queued for re-testing.
Comment #16
fastangel CreditAttribution: fastangel commentedThis issue is blocked for #1708692: Bundle services aren't available in the request that enables the module
Comment #17
dawehnerDo we still require this to be opened, it's clear that not views is the problem.
Comment #18
dawehnerWe have proven that
Comment #20
xjmMore correct status.