Bug 19797 - Subscriptions to email notifications for new serial issues are broken
Summary: Subscriptions to email notifications for new serial issues are broken
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: 16.11
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-11 23:20 UTC by Katrin Fischer
Modified: 2019-10-14 19:56 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 19797: [16.11.x] Restore alert subscribers (1.31 KB, patch)
2017-12-19 20:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19797: [16.11.x] Restore alert subscribers (1.36 KB, patch)
2018-02-27 15:37 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2017-12-11 23:20:36 UTC
The option to subscribe to email for newly arrived serial issues is something that people like a lot in Koha - currently this is broken a bit in both versions I tested.

For master:

To test:
- Add a subscription
- Make sure you set a notice template for 'notification' on the first page
- Go to the record in the OPAC
- Subscribe to email notifications from the Subscriptions tab
- Go back to the subscription detail page
- Click on the 'subscribers' link
- Verify that the list shown is empty
- Verify that the alert table in the database has the entry for the subscribed patron
- Verify that in the OPAC it now asks you to cancel subscription

For 16.11: (I can move this to a separate bug if needed)
- Follow above test plan until "subscribe..."
- Verify that the redirect is to an empty page
- Verify that the subscriber link doesn't work
- Verify that the link doesn't change to cancel and you can subscribe mulitple times
- Verify that the alert table will have multiple entries for your borrowernumber and subscription id
Comment 1 Katrin Fischer 2017-12-11 23:23:21 UTC
Note: 
In 16.11.x you can only subscribe form the full history, click 'more details' at the bottom of the subscription page to go there.
Also the link will only show, when you are logged in.
Comment 2 Katrin Fischer 2017-12-11 23:30:45 UTC
I think it stems from this change here:

http://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=27891cbfe2160a8ed72df384490430d111e6c9e8
                                 <input type="hidden" name="externalid" value="[% externalid %]">
-                                <input type="hidden" name="alerttype" value="issue">
-                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
+                                <input type="hidden" name="alerttype" value="[% alerttype %]">
+                                <input type="hidden" name="biblionumber" value="[% biblionumber | html 

When you check the alert table the type is empty, which explains the problem with the subscribers list display and possibly also the problems appearing in 16.11.x.
Comment 3 Jonathan Druart 2017-12-19 20:19:25 UTC
I do not recreate what you describe for master. Make sure you have a surname and a firstname:

MariaDB [koha_kohadev]> select surname, firstname from borrowers where borrowernumber=51;
+---------+-----------+
| surname | firstname |
+---------+-----------+
| koha    | NULL      |
+---------+-----------+

MariaDB [koha_kohadev]> select concat(surname, firstname) from borrowers where borrowernumber=51;
+----------------------------+
| concat(surname, firstname) |
+----------------------------+
| NULL                       |
+----------------------------+
Comment 4 Jonathan Druart 2017-12-19 20:31:51 UTC
Created attachment 69933 [details] [review]
Bug 19797: [16.11.x] Restore alert subscribers

This patch fixes a bad conflict between bug 18726 and bug 10357.
The alerttype variable was not passed to the template on 16.11.x

Test plan:
- Add a subscription
- Make sure you set a notice template for 'notification' on the first page
- Go to the record in the OPAC
- Subscribe to email notifications from the Subscriptions tab > More detail
- Verify that the alert table in the database has the entry for the subscribed patron
- Verify that in the OPAC it now asks you to cancel subscription
Comment 5 Jonathan Druart 2017-12-19 20:32:36 UTC
Setting to 16.11.x specific, please open another bug report if the behavior is wrong on master as well.
Comment 6 Katrin Fischer 2018-02-27 15:37:15 UTC
Created attachment 72270 [details] [review]
Bug 19797: [16.11.x] Restore alert subscribers

This patch fixes a bad conflict between bug 18726 and bug 10357.
The alerttype variable was not passed to the template on 16.11.x

Test plan:
- Add a subscription
- Make sure you set a notice template for 'notification' on the first page
- Go to the record in the OPAC
- Subscribe to email notifications from the Subscriptions tab > More detail
- Verify that the alert table in the database has the entry for the subscribed patron
- Verify that in the OPAC it now asks you to cancel subscription

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 7 Katrin Fischer 2018-02-27 15:41:51 UTC
I will retest master, but this fixes the most important blocker.
Comment 8 Jonathan Druart 2018-02-27 17:00:50 UTC
Not for master, sending to RMaints queue.
Comment 9 Chris Cormack 2018-02-27 22:30:03 UTC
Pushed to 16.11.x will be in 16.11.17