Bug #83911

Form Module changes order of options of a single select field on saving

Added by Sacha Vorbeck over 1 year ago. Updated 9 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
Start date:
2018-02-15
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When I save a form with the form BE module, the order of defined options of a single-select field gets sorted in ascending order instead of my manually selected order when I change the form, save it and then re-open it in the BE Form module editor.

Every time I re-open the form in the editor, I have to re-arrange the options again.

Oder before saving the form:

Label Value
5 5
4 4
3 3
2 2
1 1

Order after saving the form:
1 1
2 2
3 3
4 4
5 5

See attached screenshots.

formoptions.png View (29.1 KB) Sacha Vorbeck, 2018-02-15 08:04

formoptions_after_saving.png View (29.1 KB) Sacha Vorbeck, 2018-02-15 08:12


Related issues

Related to TYPO3 Core - Bug #85416: EXT:form wrong order after saving multi select element Closed 2018-06-28

Associated revisions

Revision 931f50c0 (diff)
Added by Ralf Zimmermann about 1 year ago

[BUGFIX] Preserve multivalue property sorting in form fields

This ensures e.g. the order of select options is preserved between
form edits.

Background: If you put "{"5":"5","4":"4"}" into JavaScript the order is
arbitrary. Internally this issue is already covered by the form editor
by transforming such values into some meta structure like
"[{'_label': '5', '_value': '5'}, ]{'_label': '4', '_value': '4'}".

This fails if some multivalue properties are already set, and such a
formDefinition is opened by the form editor: "{"5":"5","4":"4"}" becomes
"{"4":"4","5":"5"}".

This fix converts such multivalue properties right before this data is
interpreted by JavaScript.

Resolves: #83911
Releases: master, 8.7
Change-Id: Ife5f6be959958fcf9a2cf5c3942b2549f33287a1
Reviewed-on: https://review.typo3.org/55865
Tested-by: TYPO3com <>
Reviewed-by: Tobi Kretschmann <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Kay Strobach <>
Tested-by: Kay Strobach <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>

Revision 6b672293 (diff)
Added by Ralf Zimmermann about 1 year ago

[BUGFIX] Preserve multivalue property sorting in form fields

This ensures e.g. the order of select options is preserved between
form edits.

Background: If you put "{"5":"5","4":"4"}" into JavaScript the order is
arbitrary. Internally this issue is already covered by the form editor
by transforming such values into some meta structure like
"[{'_label': '5', '_value': '5'}, ]{'_label': '4', '_value': '4'}".

This fails if some multivalue properties are already set, and such a
formDefinition is opened by the form editor: "{"5":"5","4":"4"}" becomes
"{"4":"4","5":"5"}".

This fix converts such multivalue properties right before this data is
interpreted by JavaScript.

Resolves: #83911
Releases: master, 8.7
Change-Id: Ife5f6be959958fcf9a2cf5c3942b2549f33287a1
Reviewed-on: https://review.typo3.org/55865
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Kay Strobach <typo3@kay-strobach.de>
Tested-by: Kay Strobach <typo3@kay-strobach.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-on: https://review.typo3.org/56723

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55865

#2 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55865

#3 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55865

#4 Updated by Ralf Zimmermann about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#5 Updated by Gerrit Code Review about 1 year ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56723

#6 Updated by Ralf Zimmermann about 1 year ago

  • Status changed from Under Review to Resolved

#7 Updated by Ralf Zimmermann 12 months ago

  • Related to Bug #85416: EXT:form wrong order after saving multi select element added

#8 Updated by Benni Mack 9 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF