Problem/Motivation
We observe orphaned and misattributed elements when deleting elements. The causes are not fully clear yet, this issue should provide a place to investigate.
Ways for creating malformed data
- (1): Deleting an element and then restoring it with CTRL+Z / Undo causes the element to be still be marked as deleted.
- (2): Moving an element to a different parent creates two patch requests. If one of them fails, the stored data is incorrect (wrong
parent on moved element or wrong children list on source or target element)
- (3): Deleting elements did not properly mark them as deleted and didn't mark them as unpublished.
Proposed resolution
- (1): On restoring an element, set both deleted and published status to 0 and disable redo/undo.
- (2): Only call target element by checking childrens list before saving component and create data consistency on backend by altering source element / moved element.
- (3): Properly adress the field value of "deleted" and set "status" to 0 on deletion.
Remaining tasks
User interface changes
- Undo/redo is no longer avaiable (as intended by Design).
API changes
- Deleted elements are also marked as unpublished.
- The debugger now can also handle styles properly and deletes or unpublishes as well
Data model changes
None
Issue fork pagedesigner-3409003
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
pvbergen commentedComment #7
pvbergen commented