function commerce_product_entity_form_display_update in Commerce Core 8.2
Implements hook_ENTITY_TYPE_update().
File
- modules/
product/ commerce_product.module, line 33 - Defines the Product entity and associated features.
Code
function commerce_product_entity_form_display_update(EntityFormDisplayInterface $form_display) {
// Reset the cached attribute field map when the 'default' product variation
// form mode is updated, since the map ordering is based on it.
if ($form_display
->getTargetEntityTypeId() == 'commerce_product_variation' && $form_display
->getMode() == 'default') {
$attribute_field_manager = \Drupal::service('commerce_product.attribute_field_manager');
$attribute_field_manager
->clearCaches();
}
}