Commit 7ae76b6a authored by bojanz's avatar bojanz

Fix a strict warning in StateItem.

parent 1fcb095c
......@@ -130,7 +130,8 @@ class StateItem extends FieldItemBase implements OptionsProviderInterface {
*/
public function applyDefaultValue($notify = TRUE) {
if ($workflow = $this->getWorkflow()) {
$initial_state = reset($workflow->getStates());
$states = $workflow->getStates();
$initial_state = reset($states);
$this->setValue(['value' => $initial_state->getId()], $notify);
}
return $this;
......
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