Bug 16702 - Notice Triggers Issue: Delivery Mechanism Options Not Saving
Summary: Notice Triggers Issue: Delivery Mechanism Options Not Saving
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: 16.05
Hardware: PC Linux
: P5 - low blocker (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-09 15:00 UTC by Craig
Modified: 2019-06-27 09:24 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig 2016-06-09 15:00:27 UTC
Problem with Notice & Status Triggers (Tools › Notice triggers)

When attempting to save my notice trigger configuration after

(1) setting a delay integer, 
(2) selecting an overdue notice template, and 
(3) then choosing a delivery type (Email, SMS, etc.), 

the configuration saves but without the any of the delivery method types saving/sticking - they reset to an unchecked status. 

I do get a "changes saved" confirmation overall, but my delivery mechanism selections disappear for Email, Print, and SMS after clicking the "Save Changes" button.
Comment 1 Craig 2016-06-09 19:32:11 UTC
As follow-up to the initial bug report...

From intranet-error.log:

=======BEGIN LOG ENTRY=======
[Thu Jun 09 13:38:06.017496 2016] [cgi:error] [pid 14102] [client 174.113.255.196:54329] AH01215: [Thu Jun  9 13:38:06 2016] overduerules.pl: 

DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_library`.`overduerules_transport_types`, CONSTRAINT `overduerules_transport_types_ibfk_1` FOREIGN KEY (`overduerules_id`) REFERENCES `old_overduerules` (`overduerules_id`) ON DELETE CASC) [for Statement ", referer: https://library.craigbutosi.ca/cgi-bin/koha/tools/overduerules.pl

[Thu Jun 09 13:38:06.017674 2016] [cgi:error] [pid 14102] [client 174.113.255.196:54329] AH01215: [Thu Jun  9 13:38:06 2016] overduerules.pl:         INSERT INTO overduerules_transport_types(, referer: https://library.craigbutosi.ca/cgi-bin/koha/tools/overduerules.pl

[Thu Jun 09 13:38:06.017788 2016] [cgi:error] [pid 14102] [client 174.113.255.196:54329] AH01215: [Thu Jun  9 13:38:06 2016] overduerules.pl:             overduerules_id, letternumber, message_transport_type, referer: https://library.craigbutosi.ca/cgi-bin/koha/tools/overduerules.pl

[Thu Jun 09 13:38:06.017854 2016] [cgi:error] [pid 14102] [client 174.113.255.196:54329] AH01215: [Thu Jun  9 13:38:06 2016] overduerules.pl:         ) VALUES (, referer: https://library.craigbutosi.ca/cgi-bin/koha/tools/overduerules.pl

[Thu Jun 09 13:38:06.018004 2016] [cgi:error] [pid 14102] [client 174.113.255.196:54329] AH01215: [Thu Jun  9 13:38:06 2016] overduerules.pl:             (SELECT overduerules_id FROM overduerules WHERE branchcode = ? AND categorycode = ?), ?, ?, referer: https://library.craigbutosi.ca/cgi-bin/koha/tools/overduerules.pl

[Thu Jun 09 13:38:06.018095 2016] [cgi:error] [pid 14102] [client 174.113.255.196:54329] AH01215: [Thu Jun  9 13:38:06 2016] overduerules.pl:         ), referer: https://library.craigbutosi.ca/cgi-bin/koha/tools/overduerules.pl

[Thu Jun 09 13:38:06.018279 2016] [cgi:error] [pid 14102] [client 174.113.255.196:54329] AH01215: [Thu Jun  9 13:38:06 2016] overduerules.pl:     " with ParamValues: 0="MAIN", 1='BOR', 2=1, 3="email"] at /usr/share/koha/intranet/cgi-bin/tools/overduerules.pl line 200., referer: https://library.craigbutosi.ca/cgi-bin/koha/tools/overduerules.pl
=======END LOG ENTRY=======

Haven't the foggiest what this means specifically. My gut tells me that sql is searching for data or a table that isn't currently there, and cannot write. Though I am very unsure. Have no idea why this would happen.
Comment 2 Craig 2016-06-14 01:57:21 UTC
This was the result of a corrupted SQL schema. Perhaps from incorrectly upgrading from 3.22 to 16.05 by restoring an sql dump from 3.22 into 16.05. 

I haven't been able to reproduce the transport option save failure on a fresh install of 16.05. Everything looks good here.
Comment 3 Yakub 2017-11-26 04:48:28 UTC
This issue can be fixed using mysql hack by renaming overduerules table to old_overduerules then change back to overduerules.
Comment 4 Liz Rea 2018-08-29 00:45:14 UTC
I ended up fixing this by dropping the overduerules and overduerules_transport_types tables (there were hardly any entries anyway) and recreating them from the schema of the version I was running (in this case, 17.05).