[Koha-bugs] [Bug 10867] New: Adding label to batch, search by date requires "on or after date".

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Sep 10 17:52:50 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10867

            Bug ID: 10867
           Summary: Adding label to batch, search by date requires "on or
                    after date".
 Change sponsored?: ---
           Product: Koha
           Version: 3.12
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Label printing
          Assignee: cnighswonger at foundations.edu
          Reporter: rudolfbyker at gmail.com
        QA Contact: testopia at bugs.koha-community.org

When searching for items to add to a batch of labels, the "Added on or after
date" has to be filled in when the "Added on or before date" field is filled
in.

Steps to reproduce:

** Log in, and go to Home › Tools › Labels home › Manage label Batches › New
Batch › Add Items
** Select a date in the "on or before" field, but not in the "on or after"
field.
** It does not matter whether a keyword/title/etc. is specified.
** Click "Search"
** Error occurs:

Software error:

Can't call method "output" without a package or object reference at
/usr/share/koha/intranet/cgi-bin/labels/label-item-search.pl line 100.

Taking a look at the code:

     77     $datefrom = $query->param('datefrom');
     78     $dateto   = $query->param('dateto');
     79 
     80     if ($datefrom) {
     81         $datefrom = C4::Dates->new($datefrom);
     82         if ($QParser) {
     83             $ccl_query .= ' && ' if $ccl_textbox;
     84             $ccl_query .=
     85                 "acqdate(" . $datefrom->output("iso") . '-)';
     86         } else {
     87             $ccl_query .= ' and ' if $ccl_textbox;
     88             $ccl_query .=
     89                 "acqdate,st-date-normalized,ge=" .
$datefrom->output("iso");
     90         }
     91     }
     92 
     93     if ($dateto) {
     94         $dateto = C4::Dates->new($dateto);
     95         if ($QParser) {
     96             $ccl_query .= ' && ' if ( $ccl_textbox || $datefrom );
     97             $ccl_query .= "acqdate(-" . $dateto->output("iso") . ')';
     98         } else {
     99             $ccl_query .= ' and ' if ( $ccl_textbox || $datefrom );
    100             $ccl_query .= "acqdate,st-date-normalized,le=" .
$datefrom->output("iso");
    101         }
    102     }

At line 100, $datefrom is used, without cheking whether it is set.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list