Allow the dynamic creation of Directory taxonomy terms

Created on 8 February 2023, over 1 year ago
Updated 7 July 2023, 12 months ago

Problem/Motivation

Users might require the dynamic creation of taxonomy terms during the Media editting process.

However the default field settings do not have the "Create referenced entities if they don't already exist" (auto_create) option available to configure.

Steps to reproduce

Attempt to create/edit a Media entity, but also attempt to put in a new Directory Taxonomy term.

Proposed resolution

Add a "Create referenced taxonomy term if they don't already exist" option in the Media Directory configuration page which updates the existing media_directories_entity_base_field_info() hook.

Something along the lines of:

$fields['directory']
  ->setSetting('handler_settings', [
    'target_bundles' => [$vocabulary => $vocabulary],
    'auto_create' => true,
    'auto_create_bundle' => $vocabulary,
]);

Remaining tasks

Provide patch/issue fork.

User interface changes

There will be a new form configuration to enable/disable the ability to create new taxonomy terms as necessary.

API changes

N/A

✨ Feature request
Status

Needs review

Version

2.1

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024