Commit 631e8d84 authored by alexpott's avatar alexpott

Issue #2724903 by rocketeerbkw, gaurav.kapoor, Jo Fitzgerald, phenaproxima:...

Issue #2724903 by rocketeerbkw, gaurav.kapoor, Jo Fitzgerald, phenaproxima: Migrated custom block body field is hidden on form and display
parent 40d1faf8
id: block_content_entity_display
label: Body field display configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: embedded_data
data_rows:
-
entity_type: block_content
bundle: basic
view_mode: default
field_name: body
options:
label: hidden
ids:
entity_type:
type: string
bundle:
type: string
view_mode:
type: string
field_name:
type: string
process:
entity_type: entity_type
bundle: bundle
view_mode: view_mode
field_name: field_name
options: options
destination:
plugin: component_entity_display
migration_dependencies:
required:
- block_content_body_field
provider:
- block_content
- migrate_drupal
id: block_content_entity_form_display
label: Body field form display configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: embedded_data
data_rows:
-
entity_type: block_content
bundle: basic
form_mode: default
field_name: body
ids:
entity_type:
type: string
bundle:
type: string
form_mode:
type: string
field_name:
type: string
process:
entity_type: entity_type
bundle: bundle
form_mode: form_mode
field_name: field_name
destination:
plugin: component_entity_form_display
migration_dependencies:
required:
- block_content_body_field
provider:
- block_content
- migrate_drupal
<?php
namespace Drupal\Tests\block_content\Kernel\Migrate;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Tests migration of block content body field display configuration.
*
* @group block_content
*/
class MigrateBlockContentEntityDisplayTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['block', 'block_content', 'filter', 'text'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->executeMigrations([
'block_content_type',
'block_content_body_field',
'block_content_entity_display',
]);
}
/**
* Asserts a display entity.
*
* @param string $id
* The entity ID.
* @param string $component_id
* The ID of the display component.
*/
protected function assertDisplay($id, $component_id) {
$component = EntityViewDisplay::load($id)->getComponent($component_id);
$this->assertInternalType('array', $component);
$this->assertSame('hidden', $component['label']);
}
/**
* Tests the migrated display configuration.
*/
public function testMigration() {
$this->assertDisplay('block_content.basic.default', 'body');
}
}
<?php
namespace Drupal\Tests\block_content\Kernel\Migrate;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Tests migration of block content body field form display configuration.
*
* @group block_content
*/
class MigrateBlockContentEntityFormDisplayTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['block', 'block_content', 'filter', 'text'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->executeMigrations([
'block_content_type',
'block_content_body_field',
'block_content_entity_form_display',
]);
}
/**
* Asserts a display entity.
*
* @param string $id
* The entity ID.
* @param string $component
* The ID of the form component.
*/
protected function assertDisplay($id, $component_id) {
$component = EntityFormDisplay::load($id)->getComponent($component_id);
$this->assertInternalType('array', $component);
$this->assertSame('text_textarea_with_summary', $component['type']);
}
/**
* Tests the migrated display configuration.
*/
public function testMigration() {
$this->assertDisplay('block_content.basic.default', 'body');
}
}
......@@ -70,6 +70,14 @@ class MigrateUpgradeForm extends ConfirmFormBase {
'source_module' => 'block',
'destination_module' => 'block',
],
'block_content_entity_form_display' => [
'source_module' => 'block',
'destination_module' => 'block_content',
],
'block_content_entity_display' => [
'source_module' => 'block',
'destination_module' => 'block_content',
],
'block_content_body_field' => [
'source_module' => 'block',
'destination_module' => 'block_content',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment