Allow to extend ProjectBrowserSource plugins

Created on 27 November 2024, 6 months ago

Problem/Motivation

As an example, the plugin at \Drupal\project_browser\Plugin\ProjectBrowserSource\Recipes declares a lot of components private, which could also be protected instead.

This would allow to extend that plugin to e.g. provide a separate location for recipes, which is what we're doing for an application that we build and end-users should be able to enhance by applying application specific recipes. For that we would only want to override the getFinder() method.

Proposed resolution

Change the scope for class variables and the getFinder() method from private to protected.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

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

Merge Requests

Comments & Activities

  • Issue created by @jurgenhaas
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • Pipeline finished with Success
    6 months ago
    Total: 369s
    #351777
  • Pipeline finished with Success
    3 months ago
    Total: 1087s
    #418020
  • Status changed to Needs review 2 days ago
  • πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

    I'm speaking a bit outside my comfort zone here, but I know that we have used a Decorator pattern in order to create the "Local modules" Source plugin.

    I don't know much about decorators, so I am just coming to ask the question - whether or not approaching it from that paradigm solves the issues or if we would still need to have these methods be protected instead of private?

    That aside, I think @penyaskito's comment is actually what the intention was here, to bring in /recipes & /core/recipes together - but we were waiting on recipes being more stable to do so, or have some discoverability from d.o... though maybe that should have been marked with a @todo.

Production build 0.71.5 2024