[Bug 34776] New: Patron messaging preferences are lost when an error occurs during new account creation
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Bug ID: 34776 Summary: Patron messaging preferences are lost when an error occurs during new account creation Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: aleisha@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com To reproduce: 1. Create a new account but cause an error that will keep the account from saving (enter the wrong age for a category or give the patron a username that's already being used) 2. Set some patron messaging preferences 3. Try to save the account and wait for the "The following fields are wrong. Please fix them." message 4. Note that the patron messaging preference selections are gone and you need to re-select them Note, this depends on the EnhancedMessagingPreferences system preference to be enabled This is similar to Bug 26558 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26558 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |wainuiwitikapark@catalyst.n |ity.org |et.nz Status|NEW |ASSIGNED CC| |wainuiwitikapark@catalyst.n | |et.nz -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|wainuiwitikapark@catalyst.n |koha-bugs@lists.koha-commun |et.nz |ity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi --- Comment #1 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- This also happens when patron is duplicate (see bug 25228). It seems that when error occurs, default messaging preferences for patron category are used. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #2 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- I ran into another problem while looking into this, see bug 36368. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |emmi.takkinen@koha-suomi.fi |ity.org | --- Comment #3 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 178702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178702&action=edit Bug 34776: Restore patron messaging preferences if error occurs during new account creation If error occurs while creating a new patron messaging preferences are either lost or reseted as default fro patron category. This patch adds new method restore_form_values to restore already added messaging preferences. To test: 1. Enable syspref EnhancedMessagingPreferences. 2. Create a new patron but cause an error to prevent it from saving (e.g. add wrong age). 3. Add messaging preferences for patron (if there are default preferences, add also new ones or remove defaults). 4. Attempt to save. => Note that messaging preferences were lost and you need to readd them. 5. Apply this patch. 6. Repeat steps from 2 to 4. => Note that messaging preferences which you added are kept even if error occurs. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178702|0 |1 is obsolete| | --- Comment #4 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 178896 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178896&action=edit Bug 34776: Restore patron messaging preferences if error occurs during new account creation If error occurs while creating a new patron messaging preferences are either lost or reseted as default fro patron category. This patch adds new method restore_form_values to restore already added messaging preferences. To test: 1. Enable syspref EnhancedMessagingPreferences. 2. Create a new patron but cause an error to prevent it from saving (e.g. add wrong age). 3. Add messaging preferences for patron (if there are default preferences, add also new ones or remove defaults). 4. Attempt to save. => Note that messaging preferences were lost and you need to readd them. 5. Apply this patch. 6. Repeat steps from 2 to 4. => Note that messaging preferences which you added are kept even if error occurs. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178896|0 |1 is obsolete| | --- Comment #5 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 180100 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180100&action=edit Bug 34776: Restore patron messaging preferences if error occurs during new account creation If error occurs while creating a new patron messaging preferences are either lost or reseted as default fro patron category. This patch adds new method restore_form_values to restore already added messaging preferences. To test: 1. Enable syspref EnhancedMessagingPreferences. 2. Create a new patron but cause an error to prevent it from saving (e.g. add wrong age). 3. Add messaging preferences for patron (if there are default preferences, add also new ones or remove defaults). 4. Attempt to save. => Note that messaging preferences were lost and you need to readd them. 5. Apply this patch. 6. Repeat steps from 2 to 4. => Note that messaging preferences which you added are kept even if error occurs. Sponsored-by: Koha-Suomi Oy Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Couldnt finish here, but a few questions: This if seems unneeded :) if ( $op eq 'add_form' ) { C4::Form::MessagingPreferences::restore_form_values( $input, $template ); } else { C4::Form::MessagingPreferences::restore_form_values( $input, $template ); } + my @transport_types = $input->multi_param($message_attribute_id); + foreach my $transport_type (@transport_types) { + $option->{ 'transports_' . $transport_type } = 1; + } What is done here exactly? Not all values are transport types, right ? A new routine in a module requires a unit test. Could you add one? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #7 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Marcel de Rooy from comment #6)
Couldnt finish here, but a few questions:
This if seems unneeded :) if ( $op eq 'add_form' ) { C4::Form::MessagingPreferences::restore_form_values( $input, $template ); } else { C4::Form::MessagingPreferences::restore_form_values( $input, $template ); } Hmm, I probably assumed that if an error occurs during creating a new patron, op is still add_form. But that doesn't seem to be the case, it changes as cud-insert. So this is indeed unneeded.
+ my @transport_types = $input->multi_param($message_attribute_id); + foreach my $transport_type (@transport_types) { + $option->{ 'transports_' . $transport_type } = 1; + } What is done here exactly? Not all values are transport types, right ? While looping through all the message preferences it first finds the transport type which is selected in the form for the message preferences (by using its id). These are send from the form to back-end as key-value pairs like this: 4: 'email'. Or if sms messages are enabled 4: ['sms', 'email']. Then it loops through the found transport types. It takes the preference ($option variable), finds 'transports_[transport_type]' key and changes its value as 1.
A new routine in a module requires a unit test. Could you add one? Will do. This might take a while though since we don't have any tests for this module yet.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #8 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- I'm now a bit lost here. These methods in C4::Form::MessagingPreferences take template inputs as parameters and I think they should be located in the memberentry.pl like method patron_attributes_form. But since OPAC needs the same functionalities they have been added to separate module under C4 (search bug 3222: new module to handle messaging preferences form from git history). So we can't really tests these like normal methods as far as I can tell. Is there another way to test these? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Emmi Takkinen from comment #8)
I'm now a bit lost here. These methods in C4::Form::MessagingPreferences take template inputs as parameters and I think they should be located in the memberentry.pl like method patron_attributes_form. But since OPAC needs the same functionalities they have been added to separate module under C4 (search bug 3222: new module to handle messaging preferences form from git history). So we can't really tests these like normal methods as far as I can tell. Is there another way to test these?
Taking a look. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- The only thing we have now, is: #!/usr/bin/perl # # This Koha test module is a stub! # Add more tests here!!! use strict; use warnings; use Test::NoWarnings; use Test::More tests => 2; BEGIN { use_ok('C4::Form::MessagingPreferences'); } So I cant be harshly insisting for tests here. But let me think a little bit. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 181389 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181389&action=edit Bug 34776: Unit tests Just a small beginning.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Would you manage to add something related to what you are doing in restore_form_values in this test file attached? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #13 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 181433 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181433&action=edit Bug 34776: Remove unneeded if statement We don't need to check if $op is add_form after error, since this value always changes. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #14 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 181434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181434&action=edit Bug 34776: Add unit tests for sub restore_form_values Test that input values don't change when send to the sub restore_form_values. To test prove t/Form_MessagingPreferences.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #15 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- I added a very simple test that checks if the input values remain the same after they are handled with the restore_form_values. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |BLOCKED --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Nice. I am still seeing something wrong in the test. Hang on. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- [1] Instead of + my $set_form_values_vars = $vars; we should do something like: + my $set_form_values_vars = { %$vars }; + $vars = {}; Otherwise we are just comparing the same. [2] If you change [1], you will get an error on digest. There is something wrong. Maybe related to [3]. [3] The test does + C4::Members::Messaging::SetMessagingPreference( + { + borrowernumber => $patron->id, So changing prefs for a specific borrower. The POD of restore_form_values says: C4::Form::MessagingPreferences::restore_form_values({ borrowernumber => 51 }, $template, $input); Restores patron message preferences if error occurs while creating a patron. But the code does not look at a borrower: my ( $input, $template ) = @_; my $messaging_options = C4::Members::Messaging::GetMessagingOptions(); We do not even pass a patron. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #18 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Marcel de Rooy from comment #17)
[1] Instead of + my $set_form_values_vars = $vars;
we should do something like: + my $set_form_values_vars = { %$vars }; + $vars = {};
Otherwise we are just comparing the same.
[2] If you change [1], you will get an error on digest. There is something wrong. Maybe related to [3].
[3] The test does + C4::Members::Messaging::SetMessagingPreference( + { + borrowernumber => $patron->id, So changing prefs for a specific borrower.
The POD of restore_form_values says: C4::Form::MessagingPreferences::restore_form_values({ borrowernumber => 51 }, $template, $input); Restores patron message preferences if error occurs while creating a patron.
But the code does not look at a borrower: my ( $input, $template ) = @_; my $messaging_options = C4::Members::Messaging::GetMessagingOptions(); We do not even pass a patron.
POD is just wrong, restore_form_values receives only $input and $template params. In tests I tried to replicate the situation where we add patron with new message preferences and then we fetch them with set_form_values, hence use of SetMessagingPreference. But... now I have no idea how I thought this should work :D Back to the drawing board. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #181434|0 |1 is obsolete| | --- Comment #19 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 183221 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183221&action=edit Bug 34776: Add unit tests for sub restore_form_values Test that input values don't change when send to the sub restore_form_values. To test prove t/Form_MessagingPreferences.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #20 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed tests and POD. I added a new test to cover situation where messaging preferences are default preferences for patron category. Other still tests what happens when preferences have been stored to database via SetMessagingPreference and then set in template via set_form_values. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #21 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Forgot to run qa-tool, test file isn't tidy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183221|0 |1 is obsolete| | --- Comment #22 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 183222 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183222&action=edit Bug 34776: Add unit tests for sub restore_form_value Test that input values don't change when send to the sub restore_form_values. To test prove t/Form_MessagingPreferences.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180100|0 |1 is obsolete| | --- Comment #23 from David Nind <david@davidnind.com> --- Created attachment 183236 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183236&action=edit Bug 34776: Restore patron messaging preferences if error occurs during new account creation If error occurs while creating a new patron messaging preferences are either lost or reseted as default fro patron category. This patch adds new method restore_form_values to restore already added messaging preferences. To test: 1. Enable syspref EnhancedMessagingPreferences. 2. Create a new patron but cause an error to prevent it from saving (e.g. add wrong age). 3. Add messaging preferences for patron (if there are default preferences, add also new ones or remove defaults). 4. Attempt to save. => Note that messaging preferences were lost and you need to readd them. 5. Apply this patch. 6. Repeat steps from 2 to 4. => Note that messaging preferences which you added are kept even if error occurs. Sponsored-by: Koha-Suomi Oy Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #181389|0 |1 is obsolete| | --- Comment #24 from David Nind <david@davidnind.com> --- Created attachment 183237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183237&action=edit Bug 34776: Unit tests Just a small beginning.. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #181433|0 |1 is obsolete| | --- Comment #25 from David Nind <david@davidnind.com> --- Created attachment 183238 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183238&action=edit Bug 34776: Remove unneeded if statement We don't need to check if $op is add_form after error, since this value always changes. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #26 from David Nind <david@davidnind.com> --- Created attachment 183239 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183239&action=edit Bug 34776: Add unit tests for sub restore_form_values Test that input values don't change when send to the sub restore_form_values. To test prove t/Form_MessagingPreferences.t Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Attachment #183222|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #27 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Add a 'Kid' patron. 2. Complete all the mandatory fields. 3. Change the date of birthday so that they are over 25 years old. 4. Add some messaging preferences. 5. Attempt to save. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183236|0 |1 is obsolete| | --- Comment #28 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183573&action=edit Bug 34776: Restore patron messaging preferences if error occurs during new account creation If error occurs while creating a new patron messaging preferences are either lost or reseted as default fro patron category. This patch adds new method restore_form_values to restore already added messaging preferences. To test: 1. Enable syspref EnhancedMessagingPreferences. 2. Create a new patron but cause an error to prevent it from saving (e.g. add wrong age). 3. Add messaging preferences for patron (if there are default preferences, add also new ones or remove defaults). 4. Attempt to save. => Note that messaging preferences were lost and you need to readd them. 5. Apply this patch. 6. Repeat steps from 2 to 4. => Note that messaging preferences which you added are kept even if error occurs. Sponsored-by: Koha-Suomi Oy Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183237|0 |1 is obsolete| | --- Comment #29 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183574&action=edit Bug 34776: Unit tests Just a small beginning.. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183238|0 |1 is obsolete| | --- Comment #30 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183575&action=edit Bug 34776: Remove unneeded if statement We don't need to check if $op is add_form after error, since this value always changes. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183239|0 |1 is obsolete| | --- Comment #31 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183576&action=edit Bug 34776: Add unit tests for sub restore_form_values Test that input values don't change when send to the sub restore_form_values. To test prove t/Form_MessagingPreferences.t Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183573|0 |1 is obsolete| | --- Comment #32 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183577&action=edit Bug 34776: Restore patron messaging preferences if error occurs during new account creation If error occurs while creating a new patron messaging preferences are either lost or reseted as default fro patron category. This patch adds new method restore_form_values to restore already added messaging preferences. To test: 1. Enable syspref EnhancedMessagingPreferences. 2. Create a new patron but cause an error to prevent it from saving (e.g. add wrong age). 3. Add messaging preferences for patron (if there are default preferences, add also new ones or remove defaults). 4. Attempt to save. => Note that messaging preferences were lost and you need to readd them. 5. Apply this patch. 6. Repeat steps from 2 to 4. => Note that messaging preferences which you added are kept even if error occurs. Sponsored-by: Koha-Suomi Oy Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183574|0 |1 is obsolete| | --- Comment #33 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183578&action=edit Bug 34776: Unit tests Just a small beginning.. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183575|0 |1 is obsolete| | --- Comment #34 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183579 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183579&action=edit Bug 34776: Remove unneeded if statement We don't need to check if $op is add_form after error, since this value always changes. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183576|0 |1 is obsolete| | --- Comment #35 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 183580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183580&action=edit Bug 34776: Add unit tests for sub restore_form_values Test that input values don't change when send to the sub restore_form_values. To test prove t/Form_MessagingPreferences.t Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #36 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thx for your perseverance, Emmi! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #37 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | Text to go in the| |This fixes creating a new release notes| |patron - the messaging | |preferences are now | |remembered if there is an | |error when creating a new | |patron. Before this, if | |there was an error when | |creating a patron (for | |example, the wrong age for | |the patron category), the | |messaging preferences | |(either the default or | |changes made) were emptied | |and needed to be re-added. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|25.11.00 |25.11.00,25.05.02 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 --- Comment #38 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|25.11.00,25.05.02 |25.11.00,25.05.02,24.11.08 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #39 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #40 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34776 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #41 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org