Allow altering facets processor plugins through hook

Created on 9 April 2021, about 3 years ago
Updated 14 October 2023, 9 months ago

Just as in ✨ Allow altering facets summary processor plugins through hook RTBC , an alter hook is missing to allow altering plugin definitions, this time for processors themselves. See patch...

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom james.williams

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany szeidler Berlin

    Patch still applies for 2.x. In most cases users have control about the processor configuration. I had an edge-case where I wanted to manipulate the HierarchyProcessor, which is not that easy to do. For that the alteration of plugin info is quite helpful.

  • 🇮🇹Italy Ralkeon

    Thanks for the work. I need it for HierarchyProcessor too :D .
    I add a usage example as reference:

    /**
     * Implements hook_facets_processor_info_alter().
     */
    function custom_module_facets_processor_info_alter(array &$info) {
      $info["hierarchy_processor"]["class"] = 'Drupal\custom_module\Plugin\facets\processor\HierarchyProcessor';
    }
  • 🇩🇪Germany mkalkbrenner 🇩🇪

    I don't think that this is a good idea.
    In general you could simply add a new processor instead of replacing the class. And the new one could inherit from existing ones.

    The Hierarchy processor was special. But it has plugins now.

Production build 0.69.0 2024