Bug 25779 - ExcludeHolidaysFromMaxPickUpDelay has opposite effect
Summary: ExcludeHolidaysFromMaxPickUpDelay has opposite effect
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 19.11
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 24858
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-17 07:05 UTC by Andreas Jonsson
Modified: 2021-06-14 21:28 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Jonsson 2020-06-17 07:05:22 UTC
Holds are set to expire during holidays, although the system has been configured to not expire holds on holidays.


In C4/Hold.pm this code can be found:

    my $expirationdate = $today->clone;
    $expirationdate->add(days => $max_pickup_delay);

    if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) {
        $expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay );
    }

However, if we look in the html-code for setting the system preference we can see that the "true" value is labelled "Ignore the calendar".

    <select name="pref_ExcludeHolidaysFromMaxPickUpDelay" id="pref_ExcludeHolidaysFromMaxPickUpDelay" class="preference preference-choice valid">
      <option value="" selected="selected"> 
        Use the calendar
      </option>
      <option value="1">
        Ignore the calendar
      </option>
    </select>

So, I believe this condition should be reversed:

    my $expirationdate;

    if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) {
        $expirationdate->add(days => $max_pickup_delay);
    } else {
        $expirationdate = $today->clone;
        $expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay );
    }
Comment 1 Katrin Fischer 2020-10-19 01:09:39 UTC
I believe this has been fixed by switching the options in the pref since this bug has been filed:

<option value="" selected="selected">
  Ignore the calendar
</option>

<option value="1">
  Use the calendar
</option>