Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#3 | 2054699-config_entity_composite_id-3.patch | 3.06 KB | pcambra |
Comments
Comment #1
pcambraTagging
Comment #2
yched CreditAttribution: yched commentedMoving to config entity
Comment #3
pcambraHere'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().
Comment #4
pcambraehm, retagging, dunno why last comment changed it.
Comment #5
pcambraAgain?
Comment #6
yched CreditAttribution: yched commentedLooks good. Thanks !
Comment #7
alexpottCommitted b44b584 and pushed to 8.x. Thanks!