Update to Drupal 8.1.5. For more information, see https://www.drupal.org/project/drupal/releases/8.1.5
This commit is contained in:
parent
13b6ca7cc2
commit
38ba7c357d
342 changed files with 7814 additions and 1534 deletions
|
@ -19,6 +19,9 @@ process:
|
|||
- module
|
||||
- delta
|
||||
delimiter: _
|
||||
-
|
||||
plugin: machine_name
|
||||
field: id
|
||||
plugin:
|
||||
-
|
||||
plugin: static_map
|
||||
|
|
|
@ -291,7 +291,6 @@ class Block extends ConfigEntityBase implements BlockInterface, EntityWithPlugin
|
|||
* The condition plugin manager.
|
||||
*/
|
||||
protected function conditionPluginManager() {
|
||||
$this->conditionPluginManager;
|
||||
if (!isset($this->conditionPluginManager)) {
|
||||
$this->conditionPluginManager = \Drupal::service('plugin.manager.condition');
|
||||
}
|
||||
|
|
|
@ -43,6 +43,13 @@ class Block extends DrupalSqlBase {
|
|||
*/
|
||||
protected $blockRoleTable;
|
||||
|
||||
/**
|
||||
* Table listing user roles.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $userRoleTable;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -55,6 +62,9 @@ class Block extends DrupalSqlBase {
|
|||
$this->blockTable = 'blocks';
|
||||
$this->blockRoleTable = 'blocks_roles';
|
||||
}
|
||||
// Drupal 6 & 7 both use the same name for the user roles table.
|
||||
$this->userRoleTable = 'role';
|
||||
|
||||
return $this->select($this->blockTable, 'b')->fields('b');
|
||||
}
|
||||
|
||||
|
@ -106,11 +116,12 @@ class Block extends DrupalSqlBase {
|
|||
$module = $row->getSourceProperty('module');
|
||||
$delta = $row->getSourceProperty('delta');
|
||||
|
||||
$roles = $this->select($this->blockRoleTable, 'br')
|
||||
$query = $this->select($this->blockRoleTable, 'br')
|
||||
->fields('br', array('rid'))
|
||||
->condition('module', $module)
|
||||
->condition('delta', $delta)
|
||||
->execute()
|
||||
->condition('delta', $delta);
|
||||
$query->join($this->userRoleTable, 'ur', 'br.rid = ur.rid');
|
||||
$roles = $query->execute()
|
||||
->fetchCol();
|
||||
$row->setSourceProperty('roles', $roles);
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ class MigrateBlockTest extends MigrateDrupal7TestBase {
|
|||
$this->assertEntity('bartik_system_main', 'system_main_block', [], '', 'content', 'bartik', 0, '', '0');
|
||||
$this->assertEntity('bartik_search_form', 'search_form_block', [], '', 'sidebar_first', 'bartik', -1, '', '0');
|
||||
$this->assertEntity('bartik_user_login', 'user_login_block', [], '', 'sidebar_first', 'bartik', 0, '', '0');
|
||||
$this->assertEntity('bartik_system_powered-by', 'system_powered_by_block', [], '', 'footer', 'bartik', 10, '', '0');
|
||||
$this->assertEntity('bartik_system_powered_by', 'system_powered_by_block', [], '', 'footer', 'bartik', 10, '', '0');
|
||||
$this->assertEntity('seven_system_main', 'system_main_block', [], '', 'content', 'seven', 0, '', '0');
|
||||
$this->assertEntity('seven_user_login', 'user_login_block', [], '', 'content', 'seven', 10, '', '0');
|
||||
|
||||
|
|
|
@ -25,6 +25,39 @@ class BlockTest extends MigrateSqlSourceTestCase {
|
|||
* Sample block instance query results from the source.
|
||||
*/
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
'bid' => 1,
|
||||
'module' => 'block',
|
||||
'delta' => '1',
|
||||
'theme' => 'garland',
|
||||
'status' => 1,
|
||||
'weight' => 0,
|
||||
'region' => 'left',
|
||||
'visibility' => 0,
|
||||
'pages' => '',
|
||||
'title' => 'Test Title 01',
|
||||
'cache' => -1,
|
||||
'roles' => [2]
|
||||
),
|
||||
array(
|
||||
'bid' => 2,
|
||||
'module' => 'block',
|
||||
'delta' => '2',
|
||||
'theme' => 'garland',
|
||||
'status' => 1,
|
||||
'weight' => 5,
|
||||
'region' => 'right',
|
||||
'visibility' => 0,
|
||||
'pages' => '<front>',
|
||||
'title' => 'Test Title 02',
|
||||
'cache' => -1,
|
||||
'roles' => [2]
|
||||
),
|
||||
);
|
||||
/**
|
||||
* Sample block table.
|
||||
*/
|
||||
protected $expectedBlocks = array(
|
||||
array(
|
||||
'bid' => 1,
|
||||
'module' => 'block',
|
||||
|
@ -62,14 +95,35 @@ class BlockTest extends MigrateSqlSourceTestCase {
|
|||
'delta' => 1,
|
||||
'rid' => 2,
|
||||
),
|
||||
array(
|
||||
'module' => 'block',
|
||||
'delta' => 2,
|
||||
'rid' => 2,
|
||||
),
|
||||
array(
|
||||
'module' => 'block',
|
||||
'delta' => 2,
|
||||
'rid' => 100,
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Sample role table.
|
||||
*/
|
||||
protected $expectedRole = array(
|
||||
array(
|
||||
'rid' => 2,
|
||||
'name' => 'authenticated user',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Prepopulate database contents.
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->databaseContents['blocks'] = $this->expectedResults;
|
||||
$this->databaseContents['blocks'] = $this->expectedBlocks;
|
||||
$this->databaseContents['blocks_roles'] = $this->expectedBlocksRoles;
|
||||
$this->databaseContents['role'] = $this->expectedRole;
|
||||
$this->databaseContents['system'] = array(
|
||||
array(
|
||||
'filename' => 'modules/system/system.module',
|
||||
|
|
Reference in a new issue