Skip to content
Snippets Groups Projects
Commit 96d721c0 authored by richardpapp's avatar richardpapp Committed by richardpapp
Browse files

Fix workflow widget on entity add form.

parent 8309e3de
Branches
Tags
1 merge request!216Merging develop into main
Pipeline #1245303 passed with warnings
...@@ -252,6 +252,9 @@ ...@@ -252,6 +252,9 @@
"drupal/views_tree": { "drupal/views_tree": {
"#3344199 Add event just once": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344199.diff" "#3344199 Add event just once": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344199.diff"
}, },
"drupal/workflow": {
"#2948377 Do not hide widget when having only one option": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/show-widget-2948377-2.patch"
},
"drupal/wysiwyg_template": { "drupal/wysiwyg_template": {
"#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff" "#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff"
}, },
......
...@@ -247,6 +247,9 @@ ...@@ -247,6 +247,9 @@
"drupal/views_tree": { "drupal/views_tree": {
"#3344199 Add event just once": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344199.diff" "#3344199 Add event just once": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344199.diff"
}, },
"drupal/workflow": {
"#2948377 Do not hide widget when having only one option": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/show-widget-2948377-2.patch"
},
"drupal/wysiwyg_template": { "drupal/wysiwyg_template": {
"#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff" "#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff"
}, },
......
diff --git a/src/Entity/WorkflowState.php b/src/Entity/WorkflowState.php
index ab9660b..437bc48 100644
--- a/src/Entity/WorkflowState.php
+++ b/src/Entity/WorkflowState.php
@@ -323,7 +323,7 @@ class WorkflowState extends ConfigEntityBase {
$options = $this->getOptions($entity, $field_name, $account, $force);
$count = count($options);
// The easiest case first: more then one option: always show form.
- if ($count > 1) {
+ if ($count >= 1) {
return TRUE;
}
// #2226451: Even in Creation state, we must have 2 visible states to show the widget.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment