diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php index 7de771a..687860c 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php @@ -63,4 +63,13 @@ public function preSave() { } } } + + /** + * {@inheritdoc} + */ + public function isEmpty() { + $value = $this->get('value')->getValue(); + return $value === NULL; + } + } diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItemBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItemBase.php index 11ccec6..065310c 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItemBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItemBase.php @@ -44,7 +44,8 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel * {@inheritdoc} */ public function isEmpty() { - return $this->value === NULL || $this->value === ''; + $value = $this->get('value')->getValue(); + return $value === NULL || $value === ''; } } diff --git a/core/modules/aggregator/src/Tests/FeedProcessorPluginTest.php b/core/modules/aggregator/src/Tests/FeedProcessorPluginTest.php index 5142da5..2584021 100644 --- a/core/modules/aggregator/src/Tests/FeedProcessorPluginTest.php +++ b/core/modules/aggregator/src/Tests/FeedProcessorPluginTest.php @@ -47,9 +47,10 @@ public function testProcess() { */ public function testDelete() { $feed = $this->createFeed(); + $description = $feed->description->value ?: ''; $this->updateAndDelete($feed, NULL); // Make sure the feed title is changed. - $entities = entity_load_multiple_by_properties('aggregator_feed', array('description' => $feed->description->value)); + $entities = entity_load_multiple_by_properties('aggregator_feed', array('description' => $description)); $this->assertTrue(empty($entities)); } diff --git a/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php b/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php index 19e74fe..80404bb 100644 --- a/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php +++ b/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php @@ -44,6 +44,7 @@ protected function setUp() { $node = entity_create('node', array( 'type' => 'story', 'nid' => 1, + 'title' => $this->randomString(), )); $node->enforceIsNew(); $node->save(); diff --git a/core/modules/comment/src/Tests/Views/CommentUserNameTest.php b/core/modules/comment/src/Tests/Views/CommentUserNameTest.php index f0ef7e6..cd7825a 100644 --- a/core/modules/comment/src/Tests/Views/CommentUserNameTest.php +++ b/core/modules/comment/src/Tests/Views/CommentUserNameTest.php @@ -50,6 +50,7 @@ protected function setUp($import_test_views = TRUE) { $storage ->create(array( 'uid' => 0, + 'name' => '', 'status' => 0, )) ->save(); diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php index 17ea473..8305cf5 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php @@ -84,6 +84,7 @@ protected function setUp() { 'type' => 'story', 'nid' => $i, 'vid' => array_shift($vids), + 'title' => $this->randomString(), )); $node->enforceIsNew(); $node->save(); diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php index 62a7b0c..d78c546 100644 --- a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php +++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php @@ -111,6 +111,7 @@ protected function setUp() { 'private' => FALSE, )); $translation = $node->getTranslation('ca'); + $translation->title = $this->randomString(); $translation->field_private->value = 0; $node->save(); @@ -121,6 +122,7 @@ protected function setUp() { 'private' => TRUE, )); $translation = $node->getTranslation('ca'); + $translation->title = $this->randomString(); $translation->field_private->value = 0; $node->save(); @@ -131,6 +133,7 @@ protected function setUp() { 'private' => FALSE, )); $translation = $node->getTranslation('ca'); + $translation->title = $this->randomString(); $translation->field_private->value = 0; $node->save(); @@ -141,6 +144,7 @@ protected function setUp() { 'private' => FALSE, )); $translation = $node->getTranslation('ca'); + $translation->title = $this->randomString(); $translation->field_private->value = 1; $node->save(); @@ -151,6 +155,7 @@ protected function setUp() { 'private' => FALSE, )); $translation = $node->getTranslation('ca'); + $translation->title = $this->randomString(); $translation->field_private->value = 1; $node->save(); @@ -161,6 +166,7 @@ protected function setUp() { 'private' => TRUE, )); $translation = $node->getTranslation('ca'); + $translation->title = $this->randomString(); $translation->field_private->value = 1; $node->save(); diff --git a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php index fc5c892..4ff9f22 100644 --- a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php +++ b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php @@ -106,6 +106,7 @@ function testEntityFormLanguage() { // Create a body translation and check the form language. $langcode2 = $this->langcodes[1]; + $node->getTranslation($langcode2)->title->value = $this->randomString(); $node->getTranslation($langcode2)->body->value = $this->randomMachineName(16); $node->getTranslation($langcode2)->setOwnerId($web_user->id()); $node->save(); diff --git a/core/modules/system/src/Tests/Module/UninstallTest.php b/core/modules/system/src/Tests/Module/UninstallTest.php index 4f5e193..4b8df60 100644 --- a/core/modules/system/src/Tests/Module/UninstallTest.php +++ b/core/modules/system/src/Tests/Module/UninstallTest.php @@ -51,7 +51,7 @@ function testUninstallPage() { $node_type->setThirdPartySetting('module_test', 'key', 'value'); $node_type->save(); // Add a node to prevent node from being uninstalled. - $node = entity_create('node', array('type' => 'uninstall_blocker')); + $node = entity_create('node', array('type' => 'uninstall_blocker', 'title' => $this->randomString())); $node->save(); $this->drupalGet('admin/modules/uninstall'); diff --git a/core/modules/user/src/Tests/Condition/UserRoleConditionTest.php b/core/modules/user/src/Tests/Condition/UserRoleConditionTest.php index 567ae06..ef92e11 100644 --- a/core/modules/user/src/Tests/Condition/UserRoleConditionTest.php +++ b/core/modules/user/src/Tests/Condition/UserRoleConditionTest.php @@ -88,6 +88,7 @@ protected function setUp() { // Setup an anonymous user for our tests. $this->anonymous = User::create(array( + 'name' => '', 'uid' => 0, )); $this->anonymous->save(); diff --git a/core/modules/user/src/UserNameItem.php b/core/modules/user/src/UserNameItem.php index 0e18749..1f66bce 100644 --- a/core/modules/user/src/UserNameItem.php +++ b/core/modules/user/src/UserNameItem.php @@ -19,7 +19,7 @@ class UserNameItem extends StringItem { */ public function isEmpty() { // Anonymous users do not store anything in the database. - if ($this->getEntity()->id() == 0) { + if ($this->getEntity()->id() === 0) { return $this->value === NULL; }