Problem/Motivation

In some Analysis Webform views, the order of response fields does not match the order of the fields as configured in the original form. The fields appear in an incorrect sequence. These should be updated to reflect the same order as defined in the form configuration.

Steps to reproduce

While showing webform submission analysis data we observed that key order of options from radio/checkboxes not followed while displaying chart data. For example - If we have added any radio field in webform with options "Yes" & "No" option values. But when we webform analysis module displays chart data in Results >> Analysis Webform it follows the alphabetical order like "No" value first & then "Yes" value second.
This issue also reproducible in module provided images - https://www.drupal.org/files/project-images/Pie%20Chart.png

Proposed resolution

While preparing component rows we need follow the same order which is defined in form configuration for that specific component/field.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

yogeshmpawar created an issue. See original summary.

yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
Status: Active » Needs review

Added MR & moving issue to Needs Review state.

yogeshmpawar’s picture

Issue summary: View changes

batigolix made their first commit to this issue’s fork.

batigolix’s picture

Issue tags: +finalist-sprint

I tested this and it works.

I got a phpstan warning that I fixed. @yogeshmpawar: if you can review this , then I will merge it

yogeshmpawar’s picture

Thanks @batigolix, for fixing PHPStan error and optimize getComponentRows().

I have added one more scenario to make this reordering works, if radio buttons configured with option descriptions.

Please review the changes. Thanks.

batigolix’s picture

Status: Needs review » Reviewed & tested by the community
batigolix’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.

Status: Fixed » Closed (fixed)

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