Problem/Motivation
Let's try removing this odd code...
// Prime the module list and corresponding Extension objects.
// @todo Remove System module. Needed because
// \Drupal\Core\Datetime\DateFormatter has a (needless) dependency on the
// 'date_format' entity, so calls to DateFormatter::format() and
// DateFormatter::formatInterval() cause a plugin not found exception.
$this->moduleList = [
'system' => 0,
];
$this->moduleData = [
'system' => new Extension($this->root, 'module', 'core/modules/system/system.info.yml', 'system.module'),
];
Proposed resolution
Remove the code - it is no longer necessary. The plugin not found exception does not happen.
Remaining tasks
User interface changes
None
Introduced terminology
N/a
API changes
None
Data model changes
None
Release notes snippet
N/a
Issue fork drupal-3554308
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:
- 3554308-fix-todo-in
changes, plain diff MR !13569
Comments
Comment #3
alexpottComment #4
alexpottComment #5
berdirThis looks good I think. Not sure I understand why the container dump wasn't necessary before, but it makes sense to add that.
Comment #6
alexpottThe reason we have to set
$this->containerNeedsRebuildtoTRUEis the following code in\Drupal\Core\DrupalKernel::initializeContainerSo setting this flag to TRUE stops us from trying to get a container definition. In tests this prevents us from trying to access the database when there is potentially none set up. We could remove the
empty($this->moduleList)here but probably that's best for a follow-up with a CR etc.Comment #7
catchGood to get rid of this finally. Committed/pushed to 11.x, thanks!