Bug 6898: fix DB update that assigns the circulate/overdues_report permission
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Wed, 5 Jun 2013 12:16:14 +0000 (14:16 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 11 Jul 2013 14:51:04 +0000 (14:51 +0000)
This patch fixes a bug that prevented the circulate/overdues_report
permission from being assigned to staff users during upgrade.  This
patch will not affect databases that are already running 3.12.x
or later.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This will only fix the permissions for updates done
after the patch has been applied. But I agree with
Fridolyn, that we can not safely update permissions for
existing installations.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

installer/data/mysql/updatedatabase.pl

index adc1e7f..ef67c6b 100755 (executable)
@@ -6492,7 +6492,7 @@ if ( CheckVersion($DBversion) ) {
         VALUES  ( '1', 'overdues_report', 'Execute overdue items report' )
     });
     # add new permission for users with all report permissions and circulation remaining permission
-    my $sth = $dbh->prepare(q{
+    $dbh->do(q{
         INSERT INTO user_permissions (borrowernumber, module_bit, code)
         SELECT user_permissions.borrowernumber, 1, 'overdues_report'
         FROM user_permissions