[Bug 11945] New: Cronjob delete_expired_opac_registrations.pl fails with error in SQL syntax
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 Bug ID: 11945 Summary: Cronjob delete_expired_opac_registrations.pl fails with error in SQL syntax Change sponsored?: --- Product: Koha Version: 3.14 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: larry@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When running the cronjob, delete_expired_opac_registrations.pl on a 3.14 site, I get the following error message: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 6 at /usr/share/koha/bin/cronjobs/delete_expired_opac_registrations.pl line 76. Checking the script, I find this SQL code: my $query = " SELECT borrowernumber FROM borrowers WHERE categorycode = ? AND DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = ? ) If I run that SQL statement in the database manually, I get the same error message, e.g.: mysql> select borrowernumber from borrowers where categorycode='SELF' AND DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = 7 ); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 It would appear there's some problem with the DATEDIFF piece of the SELECT statement. - Larry -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 --- Comment #1 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 32078 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32078&action=edit Bug 11945: SQL syntax error in delete_expired_opac_registrations.pl This patch corrects a syntax error, adds some comments to the usage instructions and adds a count of the removed borrowers (with verbose flag on). Note that this is a dangerous script. It will delete your patrons in patron category PatronSelfRegistrationDefaultCategory. If you do not use this as a temporary category, you should NOT run this script. Test plan: Check PatronSelfRegistrationDefaultCategory. Check PatronSelfRegistrationExpireTemporaryAccountsDelay. Based on these two settings, check the number of patrons to be deleted (date enrolled should be before NOW minus the delay). Backup your data and run the script. Check the number of deleted borrowers. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff CC| |m.de.rooy@rijksmuseum.nl Patch complexity|--- |Small patch Version|3.14 |master Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Patrons |Command-line Utilities -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13049 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32078|0 |1 is obsolete| | --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 32091 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32091&action=edit Bug 11945: SQL syntax error in delete_expired_opac_registrations.pl This patch corrects a syntax error, adds some comments to the usage instructions and adds a count of the removed borrowers (with verbose flag on). Note that this is a dangerous script. It will delete your patrons in patron category PatronSelfRegistrationDefaultCategory. If you do not use this as a temporary category, you should NOT run this script. Test plan: Check PatronSelfRegistrationDefaultCategory. Check PatronSelfRegistrationExpireTemporaryAccountsDelay. Based on these two settings, check the number of patrons to be deleted (date enrolled should be before NOW minus the delay). Backup your data and run the script. Check the number of deleted borrowers. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32091|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 32273 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32273&action=edit Bug 11945: SQL syntax error in delete_expired_opac_registrations.pl This patch corrects a syntax error, adds some comments to the usage instructions and adds a count of the removed borrowers (with verbose flag on). Note that this is a dangerous script. It will delete your patrons in patron category PatronSelfRegistrationDefaultCategory. If you do not use this as a temporary category, you should NOT run this script. Test plan: Check PatronSelfRegistrationDefaultCategory. Check PatronSelfRegistrationExpireTemporaryAccountsDelay. Based on these two settings, check the number of patrons to be deleted (date enrolled should be before NOW minus the delay). Backup your data and run the script. Check the number of deleted borrowers. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 32274 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32274&action=edit Bug 11945: The script should die if the pref are not filled If the 2 prefs are not defined, the script should die. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Thanks Marcel and Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11945 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|13049 | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org