Skip to content
Snippets Groups Projects
Commit 1b7862d8 authored by catch's avatar catch
Browse files

Revert "Issue #2623232 by xjm, plach, benjy, penyaskito: Improve messages when...

Revert "Issue #2623232 by xjm, plach, benjy, penyaskito: Improve messages when entity/field mismatch happens"

This reverts commit 796fe6bc.
parent 7f855c94
No related branches found
No related tags found
No related merge requests found
......@@ -53,14 +53,15 @@ public function getChangeSummary() {
// Process entity type definition changes.
if (!empty($change_list['entity_type'])) {
$entity_type = $this->entityManager->getDefinition($entity_type_id);
$t_args = array('%entity_type' => $entity_type->getLabel());
switch ($change_list['entity_type']) {
case static::DEFINITION_CREATED:
$summary[$entity_type_id][] = $this->t('The %entity_type entity type needs to be installed.', ['%entity_type' => $entity_type->getLabel()]);
$summary[$entity_type_id][] = $this->t('Create the %entity_type entity type.', $t_args);
break;
case static::DEFINITION_UPDATED:
$summary[$entity_type_id][] = $this->t('The %entity_type entity type needs to be updated.', ['%entity_type' => $entity_type->getLabel()]);
$summary[$entity_type_id][] = $this->t('Update the %entity_type entity type.', $t_args);
break;
}
}
......@@ -73,15 +74,15 @@ public function getChangeSummary() {
foreach ($change_list['field_storage_definitions'] as $field_name => $change) {
switch ($change) {
case static::DEFINITION_CREATED:
$summary[$entity_type_id][] = $this->t('The %field_name field needs to be installed.', ['%field_name' => $storage_definitions[$field_name]->getLabel()]);
$summary[$entity_type_id][] = $this->t('Create the %field_name field.', array('%field_name' => $storage_definitions[$field_name]->getLabel()));
break;
case static::DEFINITION_UPDATED:
$summary[$entity_type_id][] = $this->t('The %field_name field needs to be updated.', ['%field_name' => $storage_definitions[$field_name]->getLabel()]);
$summary[$entity_type_id][] = $this->t('Update the %field_name field.', array('%field_name' => $storage_definitions[$field_name]->getLabel()));
break;
case static::DEFINITION_DELETED:
$summary[$entity_type_id][] = $this->t('The %field_name field needs to be uninstalled.', ['%field_name' => $original_storage_definitions[$field_name]->getLabel()]);
$summary[$entity_type_id][] = $this->t('Delete the %field_name field.', array('%field_name' => $original_storage_definitions[$field_name]->getLabel()));
break;
}
}
......
......@@ -181,8 +181,8 @@ public function getLanguageSwitchLinks(Request $request, $type, Url $url) {
* \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::processOutbound().
*
* @return bool
* TRUE if the the content entity language negotiator has higher priority
* than the url language negotiator, FALSE otherwise.
* TRUE if the content entity language negotiator has higher priority than
* the url language negotiator, FALSE otherwise.
*/
protected function hasLowerLanguageNegotiationWeight() {
if (!isset($this->hasLowerLanguageNegotiationWeightResult)) {
......
......@@ -105,7 +105,7 @@ public function testEntityTypeUpdateWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %entity_type entity type needs to be updated.', ['%entity_type' => $this->entityManager->getDefinition('entity_test_update')->getLabel()]),
t('Update the %entity_type entity type.', array('%entity_type' => $this->entityManager->getDefinition('entity_test_update')->getLabel())),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); //, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -144,7 +144,7 @@ public function testBaseFieldCreateUpdateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %field_name field needs to be installed.', ['%field_name' => t('A new base field')]),
t('Create the %field_name field.', array('%field_name' => t('A new base field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -157,7 +157,7 @@ public function testBaseFieldCreateUpdateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %field_name field needs to be updated.', ['%field_name' => t('A new base field')]),
t('Update the %field_name field.', array('%field_name' => t('A new base field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -170,7 +170,7 @@ public function testBaseFieldCreateUpdateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %field_name field needs to be updated.', ['%field_name' => t('A new base field')]),
t('Update the %field_name field.', array('%field_name' => t('A new base field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -184,7 +184,7 @@ public function testBaseFieldCreateUpdateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %field_name field needs to be updated.', ['%field_name' => t('A new base field')]),
t('Update the %field_name field.', array('%field_name' => t('A new base field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -199,7 +199,7 @@ public function testBaseFieldCreateUpdateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %field_name field needs to be uninstalled.', ['%field_name' => t('A new base field')]),
t('Delete the %field_name field.', array('%field_name' => t('A new base field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -218,7 +218,7 @@ public function testBundleFieldCreateUpdateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %field_name field needs to be installed.', ['%field_name' => t('A new bundle field')]),
t('Create the %field_name field.', array('%field_name' => t('A new bundle field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -231,9 +231,9 @@ public function testBundleFieldCreateUpdateDeleteWithoutData() {
$this->modifyBundleField();
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => [
t('The %field_name field needs to be updated.', ['%field_name' => t('A new bundle field')]),
],
'entity_test_update' => array(
t('Update the %field_name field.', array('%field_name' => t('A new bundle field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
$this->entityDefinitionUpdateManager->applyUpdates();
......@@ -245,7 +245,7 @@ public function testBundleFieldCreateUpdateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %field_name field needs to be uninstalled.', ['%field_name' => t('A new bundle field')]),
t('Delete the %field_name field.', array('%field_name' => t('A new bundle field'))),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -487,7 +487,7 @@ public function testEntityIndexCreateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %entity_type entity type needs to be updated.', ['%entity_type' => $this->entityManager->getDefinition('entity_test_update')->getLabel()]),
t('Update the %entity_type entity type.', array('%entity_type' => $this->entityManager->getDefinition('entity_test_update')->getLabel())),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......@@ -502,7 +502,7 @@ public function testEntityIndexCreateDeleteWithoutData() {
$this->assertTrue($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that updates are needed.');
$expected = array(
'entity_test_update' => array(
t('The %entity_type entity type needs to be updated.', ['%entity_type' => $this->entityManager->getDefinition('entity_test_update')->getLabel()]),
t('Update the %entity_type entity type.', array('%entity_type' => $this->entityManager->getDefinition('entity_test_update')->getLabel())),
),
);
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected, 'EntityDefinitionUpdateManager reports the expected change summary.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment