The issue appears to be in C4/Form/MessagingPreferences.pm 73 sub handle_form_action { ... 104 if (! $prefs_set && $insert){ 105 # this is new borrower, and we have no preferences set, use the defaults 106 $target_params->{categorycode} = $categorycode; 107 C4::Members::Messaging::SetMessagingPreferencesFromDefaults( $target_params ); 108 } ... To recreate: 1 - Enable EnhancedMessagingPreferences system preference 2 - Set some defaults for a category 3 - Create a new patron in this category 4 - Uncheck all messages before saving 5 - Note patron is created with the defaults set
Still valid, but you have to remove all settings, if you only remove some, the settings are saved correctly.
*** Bug 26520 has been marked as a duplicate of this bug. ***
Bug and nuances described in Christopher and George's koha-US The Terrific Every-Other-Thursday Training Video (19 January 2024): https://www.youtube.com/watch?v=vtjWbfQhHCU
This is a much needed fix for us.
We really need this too.
Created attachment 165170 [details] [review] Bug 30318: Don't reset messaging preferences when form is empty In testing, the messaging preferences are set in the form when EnhancedMessagingPreferences is enabled. Switching categories silently updates the preferences unless you have made changes, in which case the user is warned and can confirm if they want to reset or not. The code only applies to patron creatoin, and does not seem to be taken into account during OPAC self-registration. It seems the silent defaulting when saving can be removed in favor of the current updates/warns in the actual form. To test: 1 - Set some messaging preferences for at least two categories 2 - Enter a new patron 3 - Confirm switching categories correctly defaults the messaging preferences 4 - Edit the preferences and switch to another category with defaults 5 - Confirm the warning appears, and preferences are set if confirmed and ignored if not 6 - Set to a category with defaults, uncheck all, and save 7 - Ooof, patron is defaulted 8 - Apply patch 9 - Repeat 1-5 and confirm nothing has changed 10 - Set to a category with defaults, uncheck all, save 11 - Confirm patron is saved with no preferences
Created attachment 165217 [details] [review] Bug 30318: Don't reset messaging preferences when form is empty In testing, the messaging preferences are set in the form when EnhancedMessagingPreferences is enabled. Switching categories silently updates the preferences unless you have made changes, in which case the user is warned and can confirm if they want to reset or not. The code only applies to patron creatoin, and does not seem to be taken into account during OPAC self-registration. It seems the silent defaulting when saving can be removed in favor of the current updates/warns in the actual form. To test: 1 - Set some messaging preferences for at least two categories 2 - Enter a new patron 3 - Confirm switching categories correctly defaults the messaging preferences 4 - Edit the preferences and switch to another category with defaults 5 - Confirm the warning appears, and preferences are set if confirmed and ignored if not 6 - Set to a category with defaults, uncheck all, and save 7 - Ooof, patron is defaulted 8 - Apply patch 9 - Repeat 1-5 and confirm nothing has changed 10 - Set to a category with defaults, uncheck all, save 11 - Confirm patron is saved with no preferences Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
It looks like Andrew has signed this one off, but the status hasn't been changed.
(In reply to David Nind from comment #8) > It looks like Andrew has signed this one off, but the status hasn't been > changed. So I did, thank you.
Created attachment 165359 [details] [review] Bug 30318: Don't reset messaging preferences when form is empty In testing, the messaging preferences are set in the form when EnhancedMessagingPreferences is enabled. Switching categories silently updates the preferences unless you have made changes, in which case the user is warned and can confirm if they want to reset or not. The code only applies to patron creatoin, and does not seem to be taken into account during OPAC self-registration. It seems the silent defaulting when saving can be removed in favor of the current updates/warns in the actual form. To test: 1 - Set some messaging preferences for at least two categories 2 - Enter a new patron 3 - Confirm switching categories correctly defaults the messaging preferences 4 - Edit the preferences and switch to another category with defaults 5 - Confirm the warning appears, and preferences are set if confirmed and ignored if not 6 - Set to a category with defaults, uncheck all, and save 7 - Ooof, patron is defaulted 8 - Apply patch 9 - Repeat 1-5 and confirm nothing has changed 10 - Set to a category with defaults, uncheck all, save 11 - Confirm patron is saved with no preferences Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
The change makes sense, QA scripts are happy. Passing QA
Pushed for 24.05! Well done everyone, thank you!
Backported to 23.05.x for upcoming 23.05.12