Use the ModuleHandlerInterface instead of the ModuleHandler concrete implementation, because other modules might decorate this class and it would lead to some fatal error.

For example, with the hook_event_dispatcher module enabled, this patch caused a fatal error : https://www.drupal.org/project/hook_event_dispatcher/issues/3277301

CommentFileSizeAuthor
#2 3308343-2.patch1.76 KBrenrhaf

Comments

Renrhaf created an issue. See original summary.

renrhaf’s picture

StatusFileSize
new1.76 KB
renrhaf’s picture

Issue summary: View changes
uditrawat’s picture

Status: Active » Needs review
bobooon’s picture

#2 is the correct implementation.

+1 RTBC

mkalkbrenner’s picture

Status: Needs review » Reviewed & tested by the community

  • mkalkbrenner committed b7e1c80 on 3.0.x
    Issue #3308343 by Renrhaf, mkalkbrenner: Use the ModuleHandlerInterface...

  • mkalkbrenner committed d5f56fe on 2.0.x
    Issue #3308343 by Renrhaf, mkalkbrenner: Use the ModuleHandlerInterface...
mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.