Skip to content

fix(settings): use @update:modelValue so admin switches save again - #1598

Merged
ernolf merged 1 commit into
mainfrom
ernolf/fix/settings-update-modelvalue
Jun 8, 2026
Merged

fix(settings): use @update:modelValue so admin switches save again#1598
ernolf merged 1 commit into
mainfrom
ernolf/fix/settings-update-modelvalue

Conversation

@ernolf

@ernolf ernolf commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

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/config was ever sent.

Root cause

src/views/GuestSettings.vue wires the save handler to @update:checked:

<NcCheckboxRadioSwitch
    v-model="config.allowExternalStorage"
    type="switch"
    @update:checked="saveConfig">

NcCheckboxRadioSwitch in @nextcloud/vue 9.x emits update:modelValue, not update:checked (the bundled component declares emits: ["update:modelValue"]). So saveConfig() was never called. v-model still updated the local state, so the switch flipped visually while nothing was persisted. The group switch additionally used a one-way :modelValue together 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/vue from ^8.33.0 to ^9.6.0. That commit correctly converted :checked.sync to v-model but left the separate @update:checked="saveConfig" listeners unchanged. On @nextcloud/vue 8.x the component emitted update:checked, so both the binding and the save handler fired; on 9.x only update:modelValue is emitted. The same commit already used the correct event for NcSettingsSelectGroup (@update:modelValue="onSelectGroups"), so only the NcCheckboxRadioSwitch listeners were missed.

Affected: 4.7.0 through 4.7.5 and current main. Not affected: 4.6.x and earlier (Vue 2 / @nextcloud/vue 8). A backport to the 4.7 line is therefore needed in addition to main.

Fix

Replace @update:checked with @update:modelValue on all five NcCheckboxRadioSwitch switches (the four saveConfig switches and the group-restriction toggle).

Testing

Built against the released v4.7.5 and deployed to a live instance:

  • Toggling any switch now persists and survives a reload.
  • A PUT /apps/guests/config is now sent on toggle (previously only GET appeared in the access log).
  • The "Your settings have been updated" toast shows.
  • The group-restriction switch can now be toggled.

Fixes #995

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
@ernolf ernolf added bug Something isn't working regression Regression of a previous working feature labels Jun 7, 2026
@ernolf
ernolf requested review from nickvergessen and skjnldsv June 7, 2026 23:44
@skjnldsv
skjnldsv requested review from pringelmann and removed request for nickvergessen June 8, 2026 05:08
@ernolf
ernolf merged commit 81df892 into main Jun 8, 2026
45 checks passed
@ernolf
ernolf deleted the ernolf/fix/settings-update-modelvalue branch June 8, 2026 05:57
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

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.)

@salmart-dev salmart-dev linked an issue Jul 1, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feedback-requested regression Regression of a previous working feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings not being saved [Bug]: Not possible to disable Guest-Allowlist (change doesn't save)

3 participants