#1535868-40: Convert all blocks into plugins
or: http://qa.drupal.org/pifr/test/340923
Many irrelevant test failures:
Undefined index: plid Notice menu.module 198 menu_enable()
A hook_menu() implementation tries to use/retrieve a service that is registered by a module (bundle) -- which causes menu_router_rebuild() to blow up.
menu_router_rebuild() contains a try/catch block, so the actual exception is hidden. As a result, menu_enable() does not find any links in the menu links table.
The actual exception thrown is:
DependencyInjection... "The service definition "plugin.manager.system.plugin_ui" does not exist."
However, this service is registered on the container in a SystemBundle
in that patch.
SystemBundle::build() gets invoked. But possibly too late or whatever.
Comment | File | Size | Author |
---|---|---|---|
#21 | bundle-registration-1786990-21.patch | 4.13 KB | effulgentsia |
#20 | drupal-1786990-18-with-views.patch | 5.38 KB | tim.plunkett |
#20 | drupal-1786990-18.patch | 3.6 KB | tim.plunkett |
#20 | interdiff.txt | 707 bytes | tim.plunkett |
#19 | bundle-registration-1786990-19.patch | 3.93 KB | effulgentsia |
Comments
Comment #1
tim.plunkettWe've been having this problem in Views, as well as #1708692: Bundle services aren't available in the request that enables the module, I think we just assumed it was all the other issue.
Comment #2
effulgentsia CreditAttribution: effulgentsia commented@tim.plunkett: Can you post a small patch here that demonstrates the bug with a failing test? I just tried a fresh checkout of Views 8.x-3.x, and tests seem to be passing without the hack in #1708692-19: Bundle services aren't available in the request that enables the module.
Comment #3
tim.plunkettSimply add
protected $profile = 'standard';
to any Views test.I can work over the next few days to distill it down to a "small patch", but in the meantime, here's this :D
Comment #4
sunI don't get that. As for the OP, the service is registered by SystemBundle, which is (or should be) available at all times, regardless of install profile.
Comment #5
tim.plunkettPerhaps the install profile part is a separate issue. Perhaps not.
But this is not normal:
Copying this over from the other issue:
Here's the relevant call stack for one such occurence: https://privatepaste.com/ddf8081988
Note lines 13 and 14. l() is being called, which is calling theme_get_registry(), and then everything goes to hell.
So, I tried putting this into ViewTestBase:
And it all worked out.
Comment #7
effulgentsia CreditAttribution: effulgentsia commentedFrom #1805996-8: [META] Views in Drupal Core:
Here's a patch that's identical to that one, but with views and views_ui added as dependencies to standard.info. I'm curious what breaks.
Comment #9
effulgentsia CreditAttribution: effulgentsia commentedWill the exact same tests fail on just this?
Comment #11
xjmThat has got to be the single best example of narrowing scope I've ever seen. 2.5 MB to less than 2K. ;)
And yep, looks like they're all croaking with:
Comment #12
effulgentsia CreditAttribution: effulgentsia commentedLooks like there's 4 ModuleAPI failures in #7 that aren't in #9. Trying to find out what's causing them.
Comment #13
effulgentsia CreditAttribution: effulgentsia commentedAh, those were a red herring, just due to standard.info not including 'config', a Views dependency. Ok, looks like registration of [Module]Bundle happening after hook_theme() is the key scope of this issue, as demonstrated in #9.
Comment #14
sunI suspect we need to turn the conclusion around. Possible causes:
1) theme() may be invoked before full bootstrap, or, before the kernel container is instantiated.
2) hook_theme() may be called by the installer, but the installer may not register bundles of modules.
3) Unlimited variations of 1) and 2) ;)
Comment #15
andypostThat's caused by filter_permission()
and then common.inc l()
Comment #16
tim.plunkettThat treats the symptom, yes.
But as sun points out in #14, this could happen in other ways as well.
Comment #17
effulgentsia CreditAttribution: effulgentsia commentedThe problem is in WebTestBase::setUp(), we install_drupal() for the profile being tested and then module_enable() any additional modules needed by the test. The module_enable() invokes hooks which could end up calling l(), or any number of other functions that end up expecting services from modules enabled by install_drupal(). Here's a really ugly fix, though I hope we can fix this more robustly in other issues like #1708692: Bundle services aren't available in the request that enables the module and #1784312: Stop doing so much pre-kernel bootstrapping.
Comment #18
sunI think we need the rebuild in all cases, not just when additional modules to install have been specified. That is, because ->kernel and ->container are provided for test classes.
Given #1774388: Unit Tests Remastered™, we likely need to move this into TestBase.
Comment #19
effulgentsia CreditAttribution: effulgentsia commentedSince both patches in #17 are green, I removed the mock Views example from here on out. I don't think we need any test case in this patch, because the real problem still needs to be dealt with in #1708692: Bundle services aren't available in the request that enables the module. The purpose of this issue is just to allow #1805996: [META] Views in Drupal Core to add Views to the Standard install profile.
This implements #18.2. #18.1 is already taken care of: notice there's 2 lines in WebTestBase :).
Comment #20
tim.plunkett@sun, if this is what you meant in your first comment, then that's fine.
As to the second part, first to RTBC wins :)
EDIT: Ignore this, go with 19.
Comment #21
effulgentsia CreditAttribution: effulgentsia commentedSame as #19, but needed to copy the
use
statement to TestBase.Comment #23
tim.plunkett#21: bundle-registration-1786990-21.patch queued for re-testing.
Comment #24
sunI'm OK with this as a temporary stop-gap, so RTBC on the assumption that the testbot comes back green at some point.
#1809248: Enable apc.enable_cli php.ini setting on testbots was deployed on two testbots, right at the time when #21 was in process of testing, so if there won't be results in a 1-2 hours, I'd recommend to re-upload this patch (or manually send it for re-testing).
(@tim.plunkett: The same apparently applies to your VDC sandbox, FWIW.)
Comment #25
webchickLooks straight-forward enough.
Committed and pushed to 8.x. Thanks!
Comment #26
tim.plunkettI don't see this in the commit log, can you
please?
Comment #27
tim.plunkettPushed now, thanks