Skip to content

Commit ac9f16b

Browse files
quietonebojanz
authored andcommitted
Issue #2944310 by quietone, bojanz: Fatal error from views_data_alter during migration
1 parent aafd17c commit ac9f16b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

modules/product/commerce_product.views.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ function commerce_product_field_views_data_alter(array &$data, FieldStorageConfi
2525
$bundle = reset($bundles);
2626
$field_name = $field_storage->getName();
2727
$field = FieldConfig::loadByName($entity_type_id, $bundle, $field_name);
28+
if (!$field) {
29+
// There is no field yet, probably because a migration is in progress.
30+
return;
31+
}
2832
$handler_settings = $field->getSetting('handler_settings');
2933
$target_bundles = array_values($handler_settings['target_bundles']);
3034
$attribute = reset($target_bundles);

0 commit comments

Comments
 (0)