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

(-)a/Koha/Hold.pm (+2 lines)
Lines 857-862 sub store { Link Here
857
857
858
        if (
858
        if (
859
            C4::Context->preference('DefaultHoldExpirationdate')
859
            C4::Context->preference('DefaultHoldExpirationdate')
860
            && C4::Context->preference('DefaultHoldExpirationdatePeriod') ne ''
860
                && !$self->expirationdate
861
                && !$self->expirationdate
861
          )
862
          )
862
        {
863
        {
Lines 871-876 sub store { Link Here
871
        if ( exists $updated_columns{reservedate} ) {
872
        if ( exists $updated_columns{reservedate} ) {
872
            if (
873
            if (
873
                C4::Context->preference('DefaultHoldExpirationdate')
874
                C4::Context->preference('DefaultHoldExpirationdate')
875
                && C4::Context->preference('DefaultHoldExpirationdatePeriod') ne ''
874
                && ! exists $updated_columns{expirationdate}
876
                && ! exists $updated_columns{expirationdate}
875
              )
877
              )
876
            {
878
            {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+1 lines)
Lines 967-972 Circulation: Link Here
967
                  months: months
967
                  months: months
968
                  years: years
968
                  years: years
969
            - from reserve date.
969
            - from reserve date.
970
            - <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>
970
        -
971
        -
971
            - When placing a hold via the staff interface default the pickup location to the
972
            - When placing a hold via the staff interface default the pickup location to the
972
            - pref: DefaultHoldPickupLocation
973
            - 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