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.
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?
Comment | File | Size | Author |
---|---|---|---|
#2 | 2936886-2.patch | 651 bytes | acbramley |
Comments
Comment #2
acbramley CreditAttribution: acbramley at PreviousNext for Transport for NSW commentedLet's see if tests pass without it.
Comment #3
saikatewu@gmail.com CreditAttribution: saikatewu@gmail.com as a volunteer commentedTried to apply the patch #2, but it didn't make any difference.
Comment #4
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedYeah, 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.
Comment #6
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedSo 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!