I am not able to see the widget when user only has a single option in workflow state.
When I check the code, the widget is only displayed when multiple options are available.

Is there any specific reason to hide?

Comments

saranya ashokkumar’s picture

Status: Active » Needs review
StatusFileSize
new584 bytes
vipul tulse’s picture

Assigned: Unassigned » vipul tulse
Issue summary: View changes
StatusFileSize
new13.52 KB

Hello,
In case of workflow have a single state the created node directly in the first default state creation (Author) than it moved to the first state.

Then why we need to show the widget because we cannot move the workflow return to creation(author state), I don't think so we need the widget here.

vipul tulse’s picture

Assigned: vipul tulse » Unassigned
vipul tulse’s picture

Assigned: Unassigned » vipul tulse
Status: Needs review » Reviewed & tested by the community

In case the above comment is not valid.

The patch is tested by applying which will display the widget to node add page.

estoyausente’s picture

I don't understand the issue. When we only have one state, the workflow state is created correctly or no? I mean, the issue description is changed and I'm don't know if the problem is that the widget is hidden (I think that is not a bug) or the problem is that the status is not created because the widget is hidden.

I'm not sure if my explanation is comprehensible.

saranya ashokkumar’s picture

Issue summary: View changes
saranya ashokkumar’s picture

Updated the issue summary.

johnv’s picture

To have a short answer to your question: If there is only 1 option, you cannot set any values.
Indeed, You may set a comment without changing the state.
Also, you may have additional fields in the Workflow box.

So this option is still under investigation. See also other issues in the Queue, that relate to the same request.

chriszz’s picture

Actually a very valuable reason to have the widget is, e.g. for and application flow the button would be "Apply now" or submit which can be nicely controlled with workflow and transition lables. But not having this breaks this idea totally. I think it must always be shown.

regards

chriszz’s picture

The patch does not work for action buttons so - will switch back to save instead of transition label...

johnv’s picture

Title: Any specific reason to hide widget when having only one option. » Do not hide widget when having only one option
johnv’s picture

Category: Support request » Feature request
johnv’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
johnv’s picture

Version: 2.0.x-dev » 2.1.x-dev
ajlib’s picture

StatusFileSize
new1.27 KB

The patch from issue #2596317 fixes the single button display problem here.

It was Drupal 7 so attaching an updated patch.

johnv’s picture

Adding #2596317 as related.

johnv’s picture

Issue summary: View changes

  • johnv committed b8e8b031 on 2.1.x
    [#2948377] Fix Do not hide widget when having only one option
    
johnv’s picture

Version: 2.1.x-dev » 2.1.9
Assigned: vipul tulse » Unassigned
Related issues: +#2879945: Show/hide Action button and Comment field when only one action is possible

This long lasting feature request is now in above commit.
It includes:
- buttons are now always displayed. If needed, you can set/reset the default 'Save' and 'Update workflow' button labels in the following page: /config/workflow/workflow/TYPE/transition_labels.

- The page /admin/config/workflow/workflow/TYPE/states now has an additional settign per state 'single state widget', where you can set the behaviour of the options widget, to either:
- display the widget
- hide the widget.
- display a formatter for the state value.
- hide the complete field
This is thanks to @liuzps, from #2879945-2: Show/hide Action button and Comment field when only one action is possible

No explicit setting for the Comment subfield is included, since als other fields can be attached. and you can hide via 'hide complete field'. Or use a hook.

johnv’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • johnv committed 8d5edea3 on 2.1.x
    [#2948377] Fix Do not hide widget when having only one option - fix...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.