Compatibility with "Taxonomy access fix" module

Created on 14 October 2021, over 3 years ago
Updated 1 May 2025, 14 days ago

Problem/Motivation

There is a conflict with the https://www.drupal.org/project/taxonomy_access_fix module when both it and Hierarchy Manager are enabled. Opening any term overview page at /admin/structure/taxonomy/manage/{vocabulary}/overview will result in a fatal error if the user doesn't have the administer taxonomy permission:

Call to a member function access() on null in taxonomy_access_fix_form_taxonomy_overview_terms_alter() (line 48 of modules/contrib/taxonomy_access_fix/taxonomy_access_fix.module).

This is due to taxonomy_access_fix relying on the vocabulary being present in the form state. Core term overview form provides this but since we're overwriting that form completely with our own it's not present since it's not required for the functionality of Hierarchy Manager.

Similarly it also expects $form['terms'] being present to handle modifications based on the reorder terms in {vocabulary} permissions which results in:

Argument 1 passed to Drupal\Core\Render\Element::children() must be of the type array, null given, called in modules/contrib/taxonomy_access_fix/taxonomy_access_fix.module on line 49

In addition to solving the conflicts could we also tie the drag & drop reordering availability in JsTree to the reorder terms in {vocabulary} permission that the module provides?

Proposed resolution

  • Resolve conflicts by adding the properties required by taxonomy_access_fix to the HmOverviewTerms form if the module is installed.
  • Set the dnd plugin of JsTree to be added conditionally, based on the reorder terms in {vocabulary} permission if the module is installed.
Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

🇱🇻Latvia artis.bajars

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