fix(settings): use @update:modelValue so admin switches save again - #1598
Conversation
Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Summary
On the Guests admin settings page none of the switches persisted: toggling any switch did nothing on save and it reverted after a reload, and the "Limit guest account creation to the following groups only" switch could not be toggled at all. No
PUT /apps/guests/configwas ever sent.Root cause
src/views/GuestSettings.vuewires the save handler to@update:checked:NcCheckboxRadioSwitchin@nextcloud/vue9.x emitsupdate:modelValue, notupdate:checked(the bundled component declaresemits: ["update:modelValue"]). SosaveConfig()was never called.v-modelstill updated the local state, so the switch flipped visually while nothing was persisted. The group switch additionally used a one-way:modelValuetogether with the same dead event, so its state never changed at all.Regression
This worked before the Vue 3 migration. It broke in
0ed6e335("chore: migrate to vue 3" #1323 ), which bumped@nextcloud/vuefrom^8.33.0to^9.6.0. That commit correctly converted:checked.synctov-modelbut left the separate@update:checked="saveConfig"listeners unchanged. On@nextcloud/vue8.x the component emittedupdate:checked, so both the binding and the save handler fired; on 9.x onlyupdate:modelValueis emitted. The same commit already used the correct event forNcSettingsSelectGroup(@update:modelValue="onSelectGroups"), so only theNcCheckboxRadioSwitchlisteners were missed.Affected:
4.7.0through4.7.5and currentmain. Not affected:4.6.xand earlier (Vue 2 /@nextcloud/vue8). A backport to the4.7line is therefore needed in addition tomain.Fix
Replace
@update:checkedwith@update:modelValueon all fiveNcCheckboxRadioSwitchswitches (the foursaveConfigswitches and the group-restriction toggle).Testing
Built against the released
v4.7.5and deployed to a live instance:PUT /apps/guests/configis now sent on toggle (previously onlyGETappeared in the access log).Fixes #995
馃 AI (if applicable)