Make possible to configure the allowed formats field types list

Created on 6 July 2021, over 3 years ago
Updated 3 July 2023, over 1 year ago

Problem/Motivation

Right now the allowed formats field types are defined directly in code, in function _allowed_formats_field_types() function. So we can not use this functionality for any other custom field type or third party module defined field type. For example, it can not be used with tablefield field type (defined in tablefield module).

Proposed resolution

Use a configuration yml file for this instead of hard-coded in the array, so new field types can be just added in the config file.

User interface changes

We could add form in the UI to configure the module with just this list of field types. However, since this is more like a developer oriented enhancement, I don't see it like a real need. For me a config file would be just fine.

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain juanolalla

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

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States douggreen Winchester, VA

    This function begins with an "_" which means that it is meant to be private.

    I suggest that you either:

    (a) add a service to expose it so that we aren't using a private function, or
    (b) rename the function here and everywhere it's used.

    We need the core maintainer to weigh in on what they'd prefer.

  • πŸ‡ͺπŸ‡ΈSpain juanolalla

    Changing version to the latest 2.0.x

  • @juanolalla opened merge request.
  • πŸ‡ͺπŸ‡ΈSpain juanolalla

    Opened a new merge request targeting 2.0.x branch

  • πŸ‡ΊπŸ‡ΈUnited States douggreen Winchester, VA

    You can ignore my comment about the private function. I was confused. I thought from the description that someone wanted to use this function with other modules, and make it more flexible at the same time. If the purpose of this change is to just make _allowed_formats_field_types more flexible with configuration, then this is great!

Production build 0.71.5 2024