Problem/Motivation

TLDR: Calling Drupal::config in hook_module_implements_alter can fire hooks too early in the bootstrapping process leading to all sorts of problems.

See #2936885: Calling EntityTypeManager::getDefinition during ConfigFactoryOverrideInterface::loadOverrides can lead to corrupt entity type handlers for a detailed description of the problem.

Proposed resolution

Move the config check to form_ds_classes_form_alter and form_field_ui_field_edit_form_alter?

In fact, I can't even see where those hooks at all in my codebase? Can we remove that entirely?

CommentFileSizeAuthor
#2 2936886-2.patch651 bytesacbramley
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley created an issue. See original summary.

acbramley’s picture

Status: Active » Needs review
FileSize
651 bytes

Let's see if tests pass without it.

saikatewu@gmail.com’s picture

Tried to apply the patch #2, but it didn't make any difference.

swentel’s picture

In fact, I can't even see where those hooks at all in my codebase? Can we remove that entirely?

Yeah, it looks like this is just totally obsolete code, going to check a bit more where this comes from, but it looks like removing them will be totally ok.

  • swentel committed c2f2e93 on 8.x-3.x authored by acbramley
    Issue #2936886 by acbramley: Drupal::config should not be called during...
swentel’s picture

Status: Needs review » Fixed

So yes, this can be removed.

- form_field_ui_field_edit_form_alter was used to set a default template on the field edit screen. This was never ported to D8
- form_ds_classes_form_alter was used to add classes for fields, however, ClassesForm::ClassesForm handles this now.

So, removed! Committed and pushed, thanks!

Status: Fixed » Closed (fixed)

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