Issue #3020718 by jibran, Sam152: system_post_update_add_expand_all_items_key_in_system_menu_block fails if blocks module is disabled

8.7.x
Alex Pott 2018-12-31 08:55:02 +01:00
parent 60574dd038
commit 48eb10555f
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
3 changed files with 39 additions and 0 deletions

View File

@ -183,6 +183,9 @@ function system_post_update_states_clear_cache() {
* Initialize 'expand_all_items' values to system_menu_block.
*/
function system_post_update_add_expand_all_items_key_in_system_menu_block(&$sandbox = NULL) {
if (!\Drupal::moduleHandler()->moduleExists('block')) {
return;
}
\Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'block', function ($block) {
return strpos($block->getPluginId(), 'system_menu_block:') === 0;
});

View File

@ -0,0 +1,36 @@
<?php
namespace Drupal\Tests\system\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
/**
* Test the system module updates with no dependencies installed.
*
* @group Update
* @group legacy
*/
class NoDependenciesUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected $installProfile = 'testing';
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../tests/fixtures/update/drupal-8.6.0.bare.testing.php.gz',
];
}
/**
* Test the system module updates with no dependencies installed.
*/
public function testNoDependenciesUpdate() {
$this->runUpdates();
}
}