Commit 2bbdb2e4 authored by facine's avatar facine Committed by jsacksick
Browse files

Issue #3150380 by facine, amateescu, loze, Spokje: PHP error adding views...

Issue #3150380 by facine, amateescu, loze, Spokje: PHP error adding views support to a computed field.
parent be3f9956
......@@ -61,8 +61,8 @@ function commerce_price_form_views_ui_config_item_form_alter(&$form, FormStateIn
/** @var \Drupal\Core\Entity\EntityFieldManagerInterface $field_manager */
$field_manager = \Drupal::service('entity_field.manager');
$field_definitions = $field_manager->getFieldStorageDefinitions($entity_type_id);
$field_definition = $field_definitions[$field_name];
if ($field_definition->getType() != 'commerce_price') {
$field_definition = $field_definitions[$field_name] ?? NULL;
if (!$field_definition || $field_definition->getType() != 'commerce_price') {
return;
}
// Remove the formatter from configurable fields, and non-applicable ones.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment