Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Applies to both 1.x and 2.x
Problem/Motivation
Facets \Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay
class currently typehints the default ModuleHandler class instead of the interface. This prevents custom overrides of ModuleHandler, for example by https://drupal.org/project/hux
Steps to reproduce
Install Hux and Facets.
Navigate to a page which triggers SearchApiDisplay.
Result: Uncaught WSOD/Exception.
Proposed resolution
Typehint the property with interface.
Remaining tasks
Review and commit.
User interface changes
Nil.
API changes
Nil.
Data model changes
Nil.
Comment | File | Size | Author |
---|---|---|---|
#4 | 3264045-02.patch | 2.49 KB | uditrawat |
Issue fork facets-3264045
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dpiComment #4
uditrawat CreditAttribution: uditrawat as a volunteer and commentedUploading MR#48 as a patch.
Tested with "2.0.5", and with "2.0.x-dev"
Comment #5
dpiThis is going to be more of an issue as sites using Hook Event Dispatcher are beginning to the same failures as it has also implemented a decorator.
Comment #6
RandalVThe patch in #4 works here on 2.0.5, it would be nice to get this committed.
As @dpi said, due to hook_event_dispatcher adding a decorator this will appear on every site using both modules, making this quite urgent. I'm changing this to major.
Comment #7
dpiGrouping together
Comment #8
idebr CreditAttribution: idebr at iO commentedThis was already fixed in #3308343: Use the ModuleHandlerInterface instead of the ModuleHandler concrete implementation
This issue targets 8.x-1.x, but this branch is no longer supported.