@@ -15,7 +15,6 @@ use Drupal\Core\Render\Element;
1515use Drupal\Core\Routing\RouteMatchInterface;
1616use Drupal\Core\Url;
1717use Drupal\field\FieldConfigInterface;
18- use Drupal\field\FieldStorageConfigInterface;
1918use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;
2019use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplayStorage;
2120use Drupal\layout_builder\Form\DefaultsEntityForm;
@@ -187,30 +186,14 @@ function layout_builder_entity_build_defaults_alter(array &$build, EntityInterfa
187186 * Implements hook_builder_module_implements_alter().
188187 */
189188function layout_builder_module_implements_alter(&$implementations, $hook) {
190- switch ($hook) {
189+ if ($hook === 'entity_view_alter' ) {
191190 // Ensure that this module's implementation of hook_entity_view_alter() runs
192191 // last so that other modules that use this hook to render extra fields will
193192 // run before it.
194- case 'entity_view_alter':
195193 $group = $implementations['layout_builder'];
196194 unset($implementations['layout_builder']);
197195 $implementations['layout_builder'] = $group;
198- break;
199-
200- // The form_alter hook in the content_translation module needs to run
201- // before Layout Builder's so field information is available in the form.
202- //
203- // The hook here can't be more specific, as the $hook that's passed in to
204- // this function is form_alter, and not form_FORM_ID_alter.
205- case 'form_alter':
206- if (isset($implementations['content_translation'])) {
207- $group = $implementations['layout_builder'];
208- unset($implementations['layout_builder']);
209- $implementations['layout_builder'] = $group;
210- }
211- break;
212196 }
213-
214197}
215198
216199/**
0 commit comments