There is some duplicate code in a couple of places related with computed ids for config entities:

   * {@inheritdoc}
  public function save() {
    // Build an ID if none is set.
    if (empty($this->id)) {
      $this->id = $this->id();
    return parent::save();

This should be moved to ConfigStorageController::create() (if the id is accessible / not protected) or ConfigEntityBase::preSave

Related: #2020895: Move save() / delete() logic in Field / FieldInstance to [pre|post]Save(), [pre|post]Delete()

#3 2054699-config_entity_composite_id-3.patch3.06 KBpcambra
PASSED: [[SimpleTest]]: [MySQL] 57,781 pass(es).
[ View ]


Issue tags:+Field API


Component:field system» configuration entity system
Issue tags:+Configuration system

Moving to config entity

Status:Active» Needs review
Issue tags:-Configuration system
new3.06 KB
PASSED: [[SimpleTest]]: [MySQL] 57,781 pass(es).
[ View ]

Here's a patch for this.
Initially I wanted to add this in the create method of the storage controller, but then I realized that the clone/duplicate methods don't go through this so I moved it to save().

ehm, retagging, dunno why last comment changed it.

Issue tags:+Field API


Status:Needs review» Reviewed & tested by the community

Looks good. Thanks !

Status:Reviewed & tested by the community» Fixed

Committed b44b584 and pushed to 8.x. Thanks!

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