ConfigEntityInterface::setOriginalID() should return $this, just like any other setter.

Files: 
CommentFileSizeAuthor
#8 interdiff.txt1.15 KBXano
#8 drupal_2088241_8.patch7.68 KBXano
PASSED: [[SimpleTest]]: [MySQL] 58,814 pass(es). View
#7 drupal_2088241_6.patch7.71 KBXano
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion. View
#7 interdiff.txt729 bytesXano
#3 drupal_2088241_3.patch6.81 KBXano
FAILED: [[SimpleTest]]: [MySQL] 58,725 pass(es), 13 fail(s), and 7 exception(s). View
#3 interdiff.txt6.27 KBXano
#1 drupal_2088241_1.patch999 bytesXano
PASSED: [[SimpleTest]]: [MySQL] 59,298 pass(es). View

Comments

Xano’s picture

Assigned: Xano » Unassigned
Status: Active » Needs review
FileSize
999 bytes
PASSED: [[SimpleTest]]: [MySQL] 59,298 pass(es). View

Also, should the method name not be setOriginalId()?

dawehner’s picture

Issue tags: +Needs tests

I also agree that it should be name setOriginalId

Xano’s picture

FileSize
6.27 KB
6.81 KB
FAILED: [[SimpleTest]]: [MySQL] 58,725 pass(es), 13 fail(s), and 7 exception(s). View
Xano’s picture

Issue tags: -Needs tests

.

Status: Needs review » Needs work

The last submitted patch, drupal_2088241_3.patch, failed testing.

dawehner’s picture

  1. +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
    @@ -28,9 +28,9 @@ public function getOriginalID();
    -   * @return void
    +   * @return \Drupal\Core\Config\Entity\ConfigEntityInterface
    

    We are using '@return self' in quite some places which gives even more information.

  2. +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php
    @@ -62,12 +78,22 @@ public function testStorageControllerMethods() {
    +    $this->assertTrue($entity->setOriginalId($id) instanceof EntityInterface);
    

    We could even check that it is the same object using spl_object_hash

Xano’s picture

Status: Needs work » Needs review
FileSize
729 bytes
7.71 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion. View
Xano’s picture

FileSize
7.68 KB
PASSED: [[SimpleTest]]: [MySQL] 58,814 pass(es). View
1.15 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!

xjm’s picture

Category: feature » task
webchick’s picture

Title: ConfigEntityInterface::setOriginalID() should return $this » Change notice: ConfigEntityInterface::setOriginalID() should return $this
Priority: Normal » Major
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Committed and pushed to 8.x. Thanks!

Will need a change notice.

Xano’s picture

Title: Change notice: ConfigEntityInterface::setOriginalID() should return $this » ConfigEntityInterface::setOriginalID() should return $this
Priority: Major » Normal
Status: Active » Fixed
Issue tags: -Needs change record

Change notice is at https://drupal.org/node/2107951.

Xano’s picture

For some reason the capitalization issue was never fixed or rolled back. See #2113319: Rename getOriginalID() to getOriginalId() and setOriginalID() to setOriginalId().

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.