Make it possible to create terms

Created on 30 August 2023, over 1 year ago
Updated 21 February 2025, about 2 months ago

Problem/Motivation

In our case we end up calling entity_access to create terms, which ultimately passes through to entity_metadata_taxonomy_access which has this:

    case "create":
      if ($entity_type == 'taxonomy_term') {
        // Check for taxonomy_access_fix contrib module which adds additional
        // permissions to create new terms in a given vocabulary.
        if (function_exists('taxonomy_access_fix_access')) {
          return taxonomy_access_fix_access('add terms', $entity->vocabulary_machine_name);
        }
      }

Rather than add that module, it's simplest to just implement that. It's safest to implement that in an if function_exists() in case we ever add that module.

Steps to reproduce

Try to create a new taxonomy.

Proposed resolution

See attached patch. Credit goes to Earl Miles.

Remaining tasks

Review and testing

Feature request
Status

Needs review

Component

Code

Created by

🇮🇹Italy marco

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

Comments & Activities

Production build 0.71.5 2024