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

(-)a/Koha/ILL/Request.pm (-19 / +2 lines)
Lines 1319-1343 sub set_copyright_clearance_confirmed { Link Here
1319
    # Normalize to boolean: 0 or 1
1319
    # Normalize to boolean: 0 or 1
1320
    my $value = $confirmed ? 1 : 0;
1320
    my $value = $confirmed ? 1 : 0;
1321
1321
1322
    # Check if attribute already exists
1322
    $self->add_or_update_attributes( { copyrightclearance_confirmed => $value } );
1323
    my $existing_attr = $self->extended_attributes->find( { type => 'copyrightclearance_confirmed' } );
1324
1323
1325
    if ($existing_attr) {
1324
    return $self;
1326
1327
        # Update existing attribute
1328
        $existing_attr->value($value)->store;
1329
    } else {
1330
1331
        # Create new attribute
1332
        $self->extended_attributes(
1333
            [
1334
                {
1335
                    type  => 'copyrightclearance_confirmed',
1336
                    value => $value,
1337
                }
1338
            ]
1339
        );
1340
    }
1341
}
1325
}
1342
1326
1343
=head3 add_or_update_attributes
1327
=head3 add_or_update_attributes
1344
- 

Return to bug 40850