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

(-)a/Koha/Hold.pm (+2 lines)
Lines 863-868 sub store { Link Here
863
863
864
        if (
864
        if (
865
            C4::Context->preference('DefaultHoldExpirationdate')
865
            C4::Context->preference('DefaultHoldExpirationdate')
866
            && C4::Context->preference('DefaultHoldExpirationdatePeriod') ne ''
866
                && !$self->expirationdate
867
                && !$self->expirationdate
867
          )
868
          )
868
        {
869
        {
Lines 877-882 sub store { Link Here
877
        if ( exists $updated_columns{reservedate} ) {
878
        if ( exists $updated_columns{reservedate} ) {
878
            if (
879
            if (
879
                C4::Context->preference('DefaultHoldExpirationdate')
880
                C4::Context->preference('DefaultHoldExpirationdate')
881
                && C4::Context->preference('DefaultHoldExpirationdatePeriod') ne ''
880
                && ! exists $updated_columns{expirationdate}
882
                && ! exists $updated_columns{expirationdate}
881
              )
883
              )
882
            {
884
            {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+1 lines)
Lines 979-984 Circulation: Link Here
979
                  months: months
979
                  months: months
980
                  years: years
980
                  years: years
981
            - from reserve date.
981
            - from reserve date.
982
            - <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>
982
        -
983
        -
983
            - When placing a hold via the staff interface default the pickup location to the
984
            - When placing a hold via the staff interface default the pickup location to the
984
            - pref: DefaultHoldPickupLocation
985
            - pref: DefaultHoldPickupLocation
(-)a/t/db_dependent/Hold.t (-2 / +19 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( $hold->expirationdate,
241
        undef, 'Expiration date not set if "DefaultHoldExpirationdatePeriod" is left empty.' );
242
225
    $schema->storage->txn_rollback();
243
    $schema->storage->txn_rollback();
226
};
244
};
227
245
228
- 

Return to bug 29074