-
Notifications
You must be signed in to change notification settings - Fork 445
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
FieldOptions with isOrderable doesn't maintain order #10529
Comments
The following PR fixes the issue in I opened the PR against PRs:main: stable-3_4_0: stable-3_3_0: TESTS ONLY:main: stable-3_4_0: stable-3_3_0: |
@blesildaramirez just following up on this. It looks like maybe the PRs to |
@NateWr Should be now all merged and testing PRs closed. Can you double check that and close the issue? Thanks! |
Confirmed working in |
Describe the bug
When a
<FieldOptions>
component has theisOrderable
prop, the options can be reordered. However, when loading the field, the options are not displayed in the order they were last saved in.The only place an orderable
FieldOptions
is used is Settings > Website > Appearance > Setup > Sidebar. There is a workaround on the backend to reorder the options before they are sent to the Vue component.pkp-lib/classes/components/forms/context/PKPAppearanceSetupForm.php
Lines 53 to 71 in b8d985f
To Reproduce
The easiest way to reproduce this is to remove the workaround code in
PKPAppearanceSetupForm.php
and then reproduce it with the sidebar setting:main
:What application are you using?
This effects as far back as
stable-3_3_0
and probably earlier.Additional information
This bug is causing problems for me when using the field as a theme option. I tried using a similar backend workaround, but it causes serious side effects. In short, I must fetch the value of the theme option to sort the order of the options. However, once I fetch the value of the theme option, all theme options are cached. This means the resorting has to be done after all theme options are defined. I can do this, but it would break any theme options defined in a child theme.
The text was updated successfully, but these errors were encountered: