Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294800

Update file usage number when translation or entity reference revisions (paragraphs) usages change

$
0
0

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

  1. Create a node of type "Article". Only fill the title.
  2. Translate the node, and embed an image in the CKEditor of the body field.
  3. Save the node.
  4. Delete the node and the translation
  5. 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

  1. Configure a new paragraph type with a formatted long text field that shows a CKEditor
  2. Add a new Entity Reference Revisions field to the "Article" content type and allow your new paragraph type.
  3. Create a node of type "Article", add a new paragraph and embed an image file in its CKEditor.
  4. Save the node
  5. Delete the node
  6. 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:
Before

After:
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


Viewing all articles
Browse latest Browse all 294800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>