Problem/Motivation
Follow-up from #2725415: Text Editor module fails to track usage of images uploaded in text_with_summary fields, allows uploaded images to be deleted
Some quotes from there:
WimLeers in #35
_editor_get_processed_text_fields() essentially hardcodes text.module's field types. I'm not sure how we can get around that. I can think of work-arounds that will enable Drupal 8 contrib to inject more field types, but I cannot think of a way to have them being found automatically; the entity/field system metadata is not rich enough for that AFAIK. In the grand scheme of things, I think this is only a small flaw though, and one that is not caused by or inherent to this issue.
Berdir in #36:
In TMGMT, I have a similar but not identical problem. Given an entity with field definitions, I want to extract all translatable text from it. That can be text fields but also string and other field types. (but not list_string, as the values there are machine names, basically, similar to format). Additionally, and that's more related to the problems that editor.module has, I would have to know how format/value/summary are connected and for which properties a format is. See http://cgit.drupalcode.org/tmgmt/tree/sources/content/src/Plugin/tmgmt/S...
Proposed resolution
Add more properties/metadata to data definitions to help solve those use cases.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork drupal-2732429
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 #2
Wim LeersMore color/history in #2725415-35: Text Editor module fails to track usage of images uploaded in text_with_summary fields, allows uploaded images to be deleted.
Comment #18
kasperg CreditAttribution: kasperg at Reload commentedI ran into this issue as well with the FAQ field module. As mentioned there the current approach which is based on extending from the
TextItemBase
class would require a rebuild of the module.An alternate approach would be to use an interface which fields could implement and provide a way to return formatted text content. I created a issue fork with an initial implementation of of such a
EditorFieldItemInterface
. Things are quite primitive but if other people like this approach it might provide a way forward.