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.
Issue fork webform_analysis-3550885
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
Comment #3
yogeshmpawarAdded MR & moving issue to Needs Review state.
Comment #4
yogeshmpawarComment #6
batigolixI tested this and it works.
I got a phpstan warning that I fixed. @yogeshmpawar: if you can review this , then I will merge it
Comment #7
yogeshmpawarThanks @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.
Comment #8
batigolixComment #9
batigolix