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 1231-1237 Link Here
1231
            [% END %]
1231
            [% END %]
1232
1232
1233
            [% IF guarantor %]
1233
            [% IF guarantor %]
1234
                select_user( '[% guarantor.borrowernumber %]', [% To.json( guarantor.unblessed ) | $raw %] );
1234
                select_user( '[% guarantor.borrowernumber %]', [% To.json( guarantor.unblessed ) | html %] );
1235
            [% END %]
1235
            [% END %]
1236
1236
1237
            $("#cn_max").hide();
1237
            $("#cn_max").hide();
(-)a/misc/cronjobs/j2a.pl (-5 / +7 lines)
Lines 129-135 if ( not $fromcat && $tocat ) { #make sure we've specified the info we need. Link Here
129
129
130
cronlogaction();
130
cronlogaction();
131
131
132
my $dbh = C4::Context->dbh;
132
my $dbh      = C4::Context->dbh;
133
my $database = Koha::Database->new();
134
my $schema   = $database->schema;
133
135
134
#get today's date, format it and subtract upperagelimit
136
#get today's date, format it and subtract upperagelimit
135
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
137
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
Lines 166-172 my $itsyourbirthday = "$year-$mon-$mday"; Link Here
166
168
167
if ( not $noaction ) {
169
if ( not $noaction ) {
168
    # Start a transaction since we need to delete from relationships and update borrowers atomically
170
    # Start a transaction since we need to delete from relationships and update borrowers atomically
169
    $dbh->{AutoCommit} = 0;
170
171
171
    my $success = 1;
172
    my $success = 1;
172
    if ($mybranch) {    #yep, we received a specific branch to work on.
173
    if ($mybranch) {    #yep, we received a specific branch to work on.
Lines 183-188 if ( not $noaction ) { Link Here
183
              )
184
              )
184
        |;
185
        |;
185
186
187
        $schema->storage->txn_begin;
188
186
        my $query = qq|
189
        my $query = qq|
187
            DELETE relationships FROM relationships
190
            DELETE relationships FROM relationships
188
            LEFT JOIN borrowers ON ( borrowers.borrowernumber = relationships.guarantee_id )
191
            LEFT JOIN borrowers ON ( borrowers.borrowernumber = relationships.guarantee_id )
Lines 202-210 if ( not $noaction ) { Link Here
202
          or $success = 0;
205
          or $success = 0;
203
206
204
        if ( $success ) {
207
        if ( $success ) {
205
            $dbh->commit;
208
            $schema->storage->txn_commit;
206
        } else {
209
        } else {
207
            $dbh->rollback;
210
            $schema->storage->txn_rollback;
208
            die "can't execute";
211
            die "can't execute";
209
        }
212
        }
210
213
211
- 

Return to bug 14570