Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing empty selection in result option choices when no default value is set #2414

Merged
merged 6 commits into from
Nov 7, 2023

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

This PR fixes an issue for service result variables when choices are used, no default value is given and "Allow empty" is not allowed:

Current behavior before PR

The choices in an analysis display the first result option, but it is not selected.
Therefore, the result can not be submitted.

Desired behavior after PR is merged

The choices in an analysis display an empty result option, and a valid option need to be selected manually.

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

Copy link
Member

@xispa xispa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value(s) work properly for all types except for multiple_choice:

Use case 1 (OK)

Captura de 2023-11-07 15-09-37

Captura de 2023-11-07 15-06-29

Use case 2 (KO)

Captura de 2023-11-07 15-11-44
Captura de 2023-11-07 15-12-30

However, making default values work properly with multi-choices has nothing to do with this PR, but changes in senaite.app.listing are required.

@xispa xispa merged commit 08fd05c into 2.x Nov 7, 2023
2 checks passed
@xispa xispa deleted the fix-empty-select-for-missing-interim-default-value branch November 7, 2023 14:24
@xispa
Copy link
Member

xispa commented Nov 7, 2023

With the following setup, default values for multichoice work as well:

Captura de 2023-11-07 15-42-34
Captura de 2023-11-07 15-42-50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants