Incompatibility with Hierarchical Term Formatter

Created on 11 November 2024, 3 months ago

Problem/Motivation

The module "Hierarchical Term Formatter" Hierarchical Term Formatter is not compatible with Custom Field.

Steps to reproduce

Create a Custom Field and a sub-field as an Entity Reference to a Taxonomy Term: the Hierarchical Term Formatters do not appear as possible formatters to be chosen, both in Manage Display of the Entity and in Views.

Proposed resolution

Make Custom Field to be compatible with Hierarchical Term Formatter module.

Remaining tasks

N/A

User interface changes

the formatter list will include the ones added by the Hierarchical Term Formatter

API changes

N/A

Data model changes

Unknown

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇮🇹Italy giuse69

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

Merge Requests

Comments & Activities

  • Issue created by @giuse69
  • 🇺🇸United States apmsooner

    This is not a bug. Custom field has it's own subfield plugin architecture so other contrib module formatters normally only affect the field itself but not its properties. Changing this to a feature request.

  • 🇮🇹Italy giuse69

    Ok, I hope this feature request can be implemented since I am using extensively Custom Field and where there are taxonomy term references that need to be displayed in their hierarchy path, I cannot use the Custom Field :)
    thanks a lot in advance
    cheers

  • 🇺🇸United States apmsooner

    I like the idea. I've looked at the other module and it shouldn't be too hard to replicate but it may take a bit for me to get to it. I want to thing about the wrapping html elements part as well as that could be something that may apply to all custom field type formatters for enhanced theming. I'll get back to this one as soon as time permits.

  • Merge request !723486757: Hierarchy formatter. → (Merged) created by apmsooner
  • 🇺🇸United States apmsooner

    Please test the patch and see if it works for you. It's basically the same implementation as the referenced module, just modified to work with custom_field.

  • 🇮🇹Italy giuse69

    Hi, it works great as a formatter in the Display of an entity - thanks!, it does not appear when the subfield is used in a view.
    cheers

  • 🇺🇸United States apmsooner

    @giuse69 - none of the formatters are currently available in views for individual sub fields, however if you select the field itself... each subfield's formatter can be selected in views. Can you tell me if you are seeing the option for the latter? For the former, thats a separate issue that I could look into later.

  • Pipeline finished with Skipped
    3 months ago
    #343704
    • apmsooner committed 23d751ac on 3.0.x
      Issue #3486757 by apmsooner, giuse69: Hierarchical Term Formatter for...
  • 🇺🇸United States apmsooner

    I was able to verify the new formatter is available in views when the field itself is selected. No formatters are currently available for individual selected subfields which is a separate issue that can be resolved separately. Otherwise, merging this as it solves the initial requirement.

  • 🇮🇹Italy giuse69

    ok, the usage of formatters defined in the subfield definition is infact a cross request, see also https://www.drupal.org/project/custom_field/issues/3473418 Subfield types list_string, list_integer Active

Production build 0.71.5 2024