When creating a guarantee, patron messaging preferences should be copied to this account from the category. Steps: Have a guarantor. Create a guarantee. Koha will use the CHILD patron category to assign this guarantee, but will not copy over the message preferences from this CHILD patron category.
YES Please!!!!
Created attachment 161595 [details] [review] Bug 31610: Set messaging preferences in the new guarantee form On patron detail page, if the patron is an adult, there is a button "Add guarantee". It takes you to the patron creation form. In this form one of the "can be guarantee" category will be automatically selected, but the messaging preferences will not be automatically set to the default messaging preferences for this category. This patch fixes that. Test plan: 1. Make sure all the "can be guarantee" categories have default messaging preferences. The category dropdown list is not sorted so it's not always the same category that appear first and is automatically selected. Also make sure that preference borrowerRelationship is not empty 2. Find a patron whose category's type is Adult and go to its detail page 3. Click on "Add guarantee" in the toolbar 4. Verify that the messaging preferences are automatically set and match the selected category.
I tested this and I am not finding this to work. I create a patron that has default messaging preferences (Adult), and then I create a guarantee (kid) for this account. Now in Koha Admin, Patron Categories, the Kid category has specific messaging preferences as does the adult, and these messaging preferences are not the same. When I create the guarantee, no messaging preferences copy over. When I go back and edit the guarantee, after saving it, I do get a popup message asking if I want to copy messaging preferences over, I clicked ok. Nothing happens. Even if I go into an already created Adult patron, I get the same popup to update/copy messaging preferences, nothing updates.
Did you clean your browser cache before testing ? As the patch only changes a JS file, it's possible that the browser loaded the old version.
I am using the sandbox- refreshed my cache- no luck. I logged out and logged back in, no luck. I also tried another browser, no luck.
Created attachment 168051 [details] [review] Bug 31610: Set messaging preferences only on "add_form"
> Even if I go into an already created Adult patron, I get the same popup to > update/copy messaging preferences, nothing updates. The popup should not appear. This is a bug caused by the first patch and fixed by the 2nd patch. However, the fact that nothing updates when you click 'OK' in the popup probably means that there is something wrong in the AJAX request, but I think it's not caused by patches on this bug. Can you try on master (without patches of this bug): edit a borrower, change it's category (popup should appear, click OK), and verify if the category preferences were applied ?
Created attachment 171427 [details] [review] Bug 31610: Set messaging preferences in the new guarantee form On patron detail page, if the patron is an adult, there is a button "Add guarantee". It takes you to the patron creation form. In this form one of the "can be guarantee" category will be automatically selected, but the messaging preferences will not be automatically set to the default messaging preferences for this category. This patch fixes that. Test plan: 1. Make sure all the "can be guarantee" categories have default messaging preferences. The category dropdown list is not sorted so it's not always the same category that appear first and is automatically selected. Also make sure that preference borrowerRelationship is not empty 2. Find a patron whose category's type is Adult and go to its detail page 3. Click on "Add guarantee" in the toolbar 4. Verify that the messaging preferences are automatically set and match the selected category. Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Created attachment 171428 [details] [review] Bug 31610: Set messaging preferences only on "add_form" Signed-off-by: Olivier V <olivier.vezina@inLibro.com>