Taxonomy Access Control Hierarch does not submit configuration form correctly if entity bundle contains colon (:) - move towards a sequence of mappings for the field names schema

Created on 21 August 2023, over 1 year ago
Updated 14 January 2024, 11 months ago

Problem/Motivation

If we have a custom entity has bundles and the bundle contains colon (:). Then the Taxonomy Access Control Hierarch does not submit configuration form correctly.

Steps to reproduce

1. Install data_pipelines module https://www.drupal.org/project/data_pipelines
2. Install workbench_access module
3. Setup an access scheme from taxonomy. Enable access scheme for some dataset bundles then save the config form.
4. The dataset bundles were selected from step 3 is not checked.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇻🇳Vietnam tannguyenhn

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

Comments & Activities

  • Issue created by @tannguyenhn
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    43 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    43 pass
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India mukhtarm

    putting in review

  • Status changed to Closed: won't fix over 1 year ago
  • 🇺🇸United States agentrickard Georgia (US)

    Colons are not allowed in bundle machine names. See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

    replace_pattern: (optional) A regular expression (without delimiters) matching disallowed characters in the machine name. Defaults to '[^a-z0-9_]+'.
    

    This is a won't fix on this side. I would suggest that you update your module code. We are not adding an exception handler for this case.

    If you want to use the patch, you can, but it will not be committed.

  • 🇨🇦Canada jibran Toronto, Canada

    Thank you for looking into it @agentrickard.

    Yes, machine name can't have : but plugins derivative separator is : and if an entity type uses bundle plugin then bundle name can have : in it.

    I'd like to get @larowlan thoughts on this, as a co-maintainer of both modules, as he added bundle plugin functionality to data pipelines. I'm happy to change data pipelines module implementation but any entity using bundle plugin, I think all the entity types created using ECK use bundle plugin, will run into the same problem if wba support is enabled.

  • Status changed to Active over 1 year ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Content types don't support :, but other bundles certainly can.

    The issue here is I used : to delimit the field name, bundle and entity type because I was having difficulty making a sequence of keyed items in the schema.

    I now know there's a better way to do that. It would be painful, but really we should migrate the fields list to be a sequence of mappings (e.g. with keys field_name, bundle and entity_type). It would clean up the schema and remove all the code for casting to and from the : version.

    It would however, require an update path.

  • 🇺🇸United States agentrickard Georgia (US)

    OK - thanks for the clarifications.

  • 🇺🇸United States agentrickard Georgia (US)

    Perhaps in the interim we should commit this patch -- and then open a new ticket for the task of changing the overall handling.

  • Status changed to Needs review about 1 year ago
  • 🇺🇸United States agentrickard Georgia (US)
  • Status changed to Needs work 11 months ago
  • 🇨🇦Canada jibran Toronto, Canada

    It would however, require an update path.

    NW for this.

Production build 0.71.5 2024