Commit edaa7f9b authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3285808: Scheduler breaks ajax requests when content moderation is enabled

parent 3290e75d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -211,7 +211,11 @@ function _scheduler_content_moderation_integration_states_values(FieldStorageDef
    return $user->hasPermission('use ' . $workflow->id() . ' transition ' . $transition->id());
  });

  $current_state = $workflow->getTypePlugin()->getState($entity->moderation_state->value);
  // Grabs the entity moderation state if it has a value, otherwise it uses the
  // default one.
  $current_state = !empty($entity->moderation_state->value) ?
    $type_plugin->getState($entity->moderation_state->value) :
    $type_plugin->getState($type_plugin->getConfiguration()['default_moderation_state']);

  // Record the possible new publish states for use when determining which of
  // the unpublish states to add as valid options.