Problem/Motivation
When importing exportable entities using the import form, the option to overwrite an existing entity does not correctly update the existing entity's export status. This means that when overwriting a 'default' configuration your changes will be deleted the next time caches clear.
This can cause seemingly random and severe changes in sight behaviour depending on what the configuration does.
Rules has same issue after copying the code from EntityAPIControllerExportable: #2027717: Import form doesn't set Rule status to 'Overridden'
Proposed resolution
Make sure the status gets copied onto the imported copy of the entity. This will make sure that the entity status gets updated in EntityAPIControllerSave.
Remaining tasks
Write patch.
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#3 | 2649382-3.patch | 781 bytes | rlmumford |
|
Comments
Comment #2
rlmumfordAdd related issue
Comment #3
rlmumfordComment #4
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 3 year old patch in #3 to entity.ui.inc applied cleanly to the latest entity 7.x-1.x-dev and (if still relevant) needs review.
Comment #5
TR CreditAttribution: TR commentedYes this is a bug. The patch proposed in #3 is very similar to the patch proposed for Rules. However, the Rules patch was not correct, as explained in #2027717-5: Import form doesn't set Rule status to 'Overridden'. To fix Rules took a considerably bigger patch plus a test case to demonstrate the bug and prove the solution. A similar solution can be used in the Entity API, but it's going to require reading that Rules issue and making a similar patch, WITH TESTS, for the Entity API.
I am not planning on doing that before D7 EOL, but I will review any contributed patches intended to solve this. Right now the functionality is broken so I'm not too worried that committing something to fix it will cause a problem.