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

(-)a/Koha/Hold.pm (+2 lines)
Lines 911-916 sub store { Link Here
911
911
912
        if (
912
        if (
913
            C4::Context->preference('DefaultHoldExpirationdate')
913
            C4::Context->preference('DefaultHoldExpirationdate')
914
            && C4::Context->preference('DefaultHoldExpirationdatePeriod') ne ''
914
                && !$self->expirationdate
915
                && !$self->expirationdate
915
          )
916
          )
916
        {
917
        {
Lines 925-930 sub store { Link Here
925
        if ( exists $updated_columns{reservedate} ) {
926
        if ( exists $updated_columns{reservedate} ) {
926
            if (
927
            if (
927
                C4::Context->preference('DefaultHoldExpirationdate')
928
                C4::Context->preference('DefaultHoldExpirationdate')
929
                && C4::Context->preference('DefaultHoldExpirationdatePeriod') ne ''
928
                && ! exists $updated_columns{expirationdate}
930
                && ! exists $updated_columns{expirationdate}
929
              )
931
              )
930
            {
932
            {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+1 lines)
Lines 968-973 Circulation: Link Here
968
                  months: months
968
                  months: months
969
                  years: years
969
                  years: years
970
            - from reserve date.
970
            - from reserve date.
971
            - <br><strong>NOTE:</strong> If <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=DefaultHoldExpirationdatePeriod">DefaultHoldExpirationdatePeriod</a> is left blank default expiration date is not set.</br>
971
        -
972
        -
972
            - When placing a hold via the staff interface default the pickup location to the
973
            - When placing a hold via the staff interface default the pickup location to the
973
            - pref: DefaultHoldPickupLocation
974
            - pref: DefaultHoldPickupLocation
(-)a/t/db_dependent/Hold.t (-2 / +21 lines)
Lines 146-152 $schema->storage->txn_rollback(); Link Here
146
146
147
subtest "store() tests" => sub {
147
subtest "store() tests" => sub {
148
148
149
    plan tests => 5;
149
    plan tests => 6;
150
150
151
    $schema->storage->txn_begin();
151
    $schema->storage->txn_begin();
152
152
Lines 222-227 subtest "store() tests" => sub { Link Here
222
    is( $hold->expirationdate,
222
    is( $hold->expirationdate,
223
        $passed_date->ymd, 'Passed expiration date when updating hold correctly set (Passing both reservedate and expirationdate.' );
223
        $passed_date->ymd, 'Passed expiration date when updating hold correctly set (Passing both reservedate and expirationdate.' );
224
224
225
    # Do not set expiration date for hold if no period is set
226
    t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdatePeriod', '' );
227
    $hold = Koha::Hold->new(
228
        {
229
            biblionumber   => $biblio->biblionumber,
230
            itemnumber     => $item->id,
231
            reservedate    => '2022-12-14',
232
            waitingdate    => '2022-12-14',
233
            borrowernumber => $borrower->borrowernumber,
234
            branchcode     => $library->branchcode,
235
            suspend        => 0,
236
        }
237
    )->store;
238
    $hold->discard_changes;
239
240
    is(
241
        $hold->expirationdate,
242
        undef, 'Expiration date not set if "DefaultHoldExpirationdatePeriod" is left empty.'
243
    );
244
225
    $schema->storage->txn_rollback();
245
    $schema->storage->txn_rollback();
226
};
246
};
227
247
228
- 

Return to bug 29074