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.
I forgot to add the workaround! Simply specify a very early date (many years ago). That will solve the problem for most users, but is inconvenient.
*** This bug has been marked as a duplicate of bug 11222 ***