diff --git a/core/lib/Drupal/Core/Field/PluginSettingsBase.php b/core/lib/Drupal/Core/Field/PluginSettingsBase.php index d161187..91a27df 100644 --- a/core/lib/Drupal/Core/Field/PluginSettingsBase.php +++ b/core/lib/Drupal/Core/Field/PluginSettingsBase.php @@ -132,9 +132,9 @@ public function onDependencyRemoval(array $dependencies) { /** * {@inheritdoc} */ - public function hasUnresolvedDependencies(array $removed) { + public function hasUnresolvedDependencies(array $removed_dependencies) { foreach ($this->calculateDependencies() as $type => $dependencies) { - if (array_intersect($dependencies, array_keys($removed[$type]))) { + if (array_intersect($dependencies, array_keys($removed_dependencies[$type]))) { return TRUE; } } diff --git a/core/lib/Drupal/Core/Field/PluginSettingsInterface.php b/core/lib/Drupal/Core/Field/PluginSettingsInterface.php index 1a27454..0707284 100644 --- a/core/lib/Drupal/Core/Field/PluginSettingsInterface.php +++ b/core/lib/Drupal/Core/Field/PluginSettingsInterface.php @@ -131,7 +131,7 @@ public function onDependencyRemoval(array $dependencies); * particular component, that component is disabled to prevent the deletion of * the entire view display entity. * - * @param array[] $removed + * @param array[] $removed_dependencies * A list of dependencies that are being removed having the same structure * as the input argument of ConfigEntityInterface::onDependencyRemoval(). * @@ -141,6 +141,6 @@ public function onDependencyRemoval(array $dependencies); * @see \Drupal\Core\Config\Entity\ConfigEntityInterface::onDependencyRemoval() * @see \Drupal\Core\Entity\EntityDisplayBase */ - public function hasUnresolvedDependencies(array $removed); + public function hasUnresolvedDependencies(array $removed_dependencies); } diff --git a/core/modules/field_ui/src/Tests/EntityDisplayTest.php b/core/modules/field_ui/src/Tests/EntityDisplayTest.php index e9649d0..446208a 100644 --- a/core/modules/field_ui/src/Tests/EntityDisplayTest.php +++ b/core/modules/field_ui/src/Tests/EntityDisplayTest.php @@ -519,9 +519,10 @@ public function testComponentDependencies() { // Reload the form display. $form_display = EntityFormDisplay::load($form_display->id()); // The display exists. - $this->assertTrue(!empty($form_display)); + $this->assertFalse(empty($form_display)); // The component has been disabled. $this->assertNull($form_display->getComponent($field_name)); + $this->assertTrue($form_display->get('hidden')[$field_name]); // The correct warning message has been logged. $arguments = ['@display' => t('Entity form display'), '@id' => $form_display->id(), '@name' => $field_name]; $logged = (bool) Database::getConnection()->select('watchdog', 'w') @@ -530,7 +531,7 @@ public function testComponentDependencies() { ->condition('message', "@display '@id': Component '@name' was disabled because its settings depend on removed dependencies.") ->condition('variables', serialize($arguments)) ->execute() - ->fetchAll(); + ->fetchField(); $this->assertTrue($logged); }