- Issue created by @sidgrafix
- 🇮🇱Israel jsacksick
Could you provide reproducible steps? Do I need to the Content moderation module? What else is needed?
When adding a moderation_state field to a view (any view) causes ajax loading issue and produces this error:
Warning: Undefined array key "moderation_state" in commerce_promotion_form_views_ui_config_item_form_alter() (line 106 of /var/www/html/web/modules/contrib/commerce/modules/promotion/commerce_promotion.module).
Once I dug into see what the issue was I found a related/similar issues reported for commerce in another area; commerce price https://www.drupal.org/project/commerce/issues/3113031 →
- Which for the most part is identical to this error, just for a different commerce sub module promotion. Based on the patch for issue 3113031 I've attached a patch for this.
Modifying: (line 106)
if ($handler instanceof EntityField && !empty($handler->definition['entity_type'])) {
to:
if ($handler instanceof EntityField && !empty($handler->definition['entity_type']) && !empty($handler->options['entity_field'])) {
Didn't investigate any further than that - there may be other sub modules using $handler instanceof EntityField
in a views form alter that should also get updated to prevent issues with moderation_state.
Active
2.40
Promotions
Could you provide reproducible steps? Do I need to the Content moderation module? What else is needed?