Inline images in the answer field are removed during file garbage collection

Created on 8 June 2016, over 8 years ago
Updated 3 February 2023, almost 2 years ago

Problem/Motivation

If you place a file in the answer formatted text field it is not marked as a permanent file and, if the site is configured to remove temporary files, it is deleted on cron. This is contrary to what happens with other text fields.

The issue arises from the Editor module. The function _editor_get_formatted_text_fields(), which is used to determine whether a given field should be scanned for embedded files, includes a hard-coded list of field types:

array('text', 'text_long', 'text_with_summary')

Because the FAQ field is not in this list, it is not recognized as a formatted text field and so ignored.

Proposed resolution

Possible fixes:

  • In a new core issue, propose a new alter hook that would be invoked in _editor_get_formatted_text_fields() to allow modules to register their field types as including formatted text, then implement the hook.
  • Refactor FAQ field to use a core field directly.
  • Replicate the complex handling that's in Editor.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany marcusx

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024