View | Details | Raw Unified | Return to bug 14570
Collapse All | Expand All

(-)a/Koha/Object.pm (-5 / +2 lines)
Lines 73-83 sub new { Link Here
73
            delete $attributes->{$column_name};
73
            delete $attributes->{$column_name};
74
        }
74
        }
75
75
76
        eval {
76
        $self->{_result} =
77
            $self->{_result} =
77
          $schema->resultset( $class->_type() )->new($attributes);
78
              $schema->resultset( $class->_type() )->new($attributes);
79
        };
80
        Carp::cluck("ERROR: $@") if $@;
81
    }
78
    }
82
79
83
    croak("No _type found! Koha::Object must be subclassed!")
80
    croak("No _type found! Koha::Object must be subclassed!")
(-)a/installer/data/mysql/atomicupdate/bug_14570.perl (-1 / +1 lines)
Lines 12-18 if( CheckVersion( $DBversion ) ) { Link Here
12
                  PRIMARY KEY (id),
12
                  PRIMARY KEY (id),
13
                  CONSTRAINT r_guarantor FOREIGN KEY ( guarantor_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE,
13
                  CONSTRAINT r_guarantor FOREIGN KEY ( guarantor_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE,
14
                  CONSTRAINT r_guarantee FOREIGN KEY ( guarantee_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
14
                  CONSTRAINT r_guarantee FOREIGN KEY ( guarantee_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
15
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
15
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
16
        });
16
        });
17
17
18
        $dbh->do(q{
18
        $dbh->do(q{
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-1 / +1 lines)
Lines 1233-1239 Link Here
1233
            [% END %]
1233
            [% END %]
1234
1234
1235
            [% IF guarantor %]
1235
            [% IF guarantor %]
1236
                select_user( '[% guarantor.borrowernumber %]', [% To.json( guarantor.unblessed ) | $raw %] );
1236
                select_user( '[% guarantor.borrowernumber %]', [% To.json( guarantor.unblessed ) | html %] );
1237
            [% END %]
1237
            [% END %]
1238
1238
1239
            $("#cn_max").hide();
1239
            $("#cn_max").hide();
(-)a/misc/cronjobs/j2a.pl (-5 / +7 lines)
Lines 128-134 if ( not $fromcat && $tocat ) { #make sure we've specified the info we need. Link Here
128
128
129
cronlogaction();
129
cronlogaction();
130
130
131
my $dbh = C4::Context->dbh;
131
my $dbh      = C4::Context->dbh;
132
my $database = Koha::Database->new();
133
my $schema   = $database->schema;
132
134
133
#get today's date, format it and subtract upperagelimit
135
#get today's date, format it and subtract upperagelimit
134
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
136
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
Lines 165-171 my $itsyourbirthday = "$year-$mon-$mday"; Link Here
165
167
166
if ( not $noaction ) {
168
if ( not $noaction ) {
167
    # Start a transaction since we need to delete from relationships and update borrowers atomically
169
    # Start a transaction since we need to delete from relationships and update borrowers atomically
168
    $dbh->{AutoCommit} = 0;
169
170
170
    my $success = 1;
171
    my $success = 1;
171
    if ($mybranch) {    #yep, we received a specific branch to work on.
172
    if ($mybranch) {    #yep, we received a specific branch to work on.
Lines 182-187 if ( not $noaction ) { Link Here
182
              )
183
              )
183
        |;
184
        |;
184
185
186
        $schema->storage->txn_begin;
187
185
        my $query = qq|
188
        my $query = qq|
186
            DELETE relationships FROM relationships
189
            DELETE relationships FROM relationships
187
            LEFT JOIN borrowers ON ( borrowers.borrowernumber = relationships.guarantee_id )
190
            LEFT JOIN borrowers ON ( borrowers.borrowernumber = relationships.guarantee_id )
Lines 201-209 if ( not $noaction ) { Link Here
201
          or $success = 0;
204
          or $success = 0;
202
205
203
        if ( $success ) {
206
        if ( $success ) {
204
            $dbh->commit;
207
            $schema->storage->txn_commit;
205
        } else {
208
        } else {
206
            $dbh->rollback;
209
            $schema->storage->txn_rollback;
207
            die "can't execute";
210
            die "can't execute";
208
        }
211
        }
209
212
210
- 

Return to bug 14570