Problem/Motivation
After deleting a node's translation, the 'Status' and 'Used in' values of the Files list (/admin/content/files
) won't be updated.
Steps to reproduce
Use case 1: File usages in translations
- Create a node of type "Article". Only fill the title.
- Translate the node, and embed an image in the CKEditor of the body field.
- Save the node.
- Delete the node and the translation
- Access '/admin/content/files'. The file status is 'Permanent', and the 'Used in' of the file is not 0.
Expectation: the image status is 'Temporary', and the 'Used in' of the file is 0.
Use case 2: File usages in paragraphs
- Configure a new paragraph type with a formatted long text field that shows a CKEditor
- Add a new Entity Reference Revisions field to the "Article" content type and allow your new paragraph type.
- Create a node of type "Article", add a new paragraph and embed an image file in its CKEditor.
- Save the node
- Delete the node
- Access '/admin/content/files', found status of the file is 'Permanent', 'Used in' of the file is not 0.
Expectation: the image status is 'Temporary', 'Used in' of the file is 0.
Proposed resolution
Refactor the editor
module to account for usages in entity paragraphs and sub-paragraphs, and to correctly set the file status when usage is zero.
Before:
After:
Remaining tasks
- [✓] - Make a fix.
- [✓] - Tests.
User interface changes
The "Used in" column in /admin/content/files
now reflects the correct usage count of files after entities using them are deleted.
API changes
None
Data model changes
None
Release notes snippet
NA