Summary: | uninitialized value in concatenation error in Opac-detail.tt | ||
---|---|---|---|
Product: | Koha | Reporter: | Humberto Blanco <hblancoca> |
Component: | OPAC | Assignee: | Nuño López Ansótegui <nunyo.lopez> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, m.de.rooy, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt
Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt |
Description
Humberto Blanco
2012-11-08 22:19:27 UTC
I think if you wrapped the line <td>[% ITEM_RESULT.datedue | $KohaDates %]</td> into an IF checking for existance of the date_due that should probably fix it. I have seen that happen in another couple of places, maybe it could be fixed on plugin level? Created attachment 15605 [details] [review] Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt Created attachment 15748 [details] [review] Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> (In reply to comment #2) > Created attachment 15605 [details] [review] [review] > Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt Hello Nuño, Is this patch only for 3.8.x? I didn't reproduce the issue on master and the patch does not apply on 3.8.x. In all cases, I think the patch is not good. The test would be on each td: <td class="date_due">[% IF ( ITEM_RESULT.datedue ) %][% ITEM_RESULT.datedue | $KohaDates %][% END %]</td> not on the tr element. Marked as Failed QA. (In reply to comment #4) > (In reply to comment #2) > > Created attachment 15605 [details] [review] [review] [review] > > Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt > > Hello Nuño, > > Is this patch only for 3.8.x? > I didn't reproduce the issue on master and the patch does not apply on 3.8.x. > In all cases, I think the patch is not good. > The test would be on each td: > <td class="date_due">[% IF ( ITEM_RESULT.datedue ) %][% > ITEM_RESULT.datedue | $KohaDates %][% END %]</td> > not on the tr element. > > Marked as Failed QA. This patch is for the master. I have done this as was done in other cases, for example in barcode. In which cases do you see warning messages? On opac-detail.pl, I just get some warnings about $ccode (Use of uninitialized value $ccode in exists at /home/koha/src/opac/opac-detail.pl line 534). (In reply to comment #6) > In which cases do you see warning messages? > > On opac-detail.pl, I just get some warnings about $ccode (Use of > uninitialized value $ccode in exists at /home/koha/src/opac/opac-detail.pl > line 534). I meant that I have written the code like the other tests, for example as the barcode code: [% IF ( itemdata_datedue ) %]<td class="date_due">[% ITEM_RESULT.datedue | $KohaDates %]</td>[% END %] [% IF ( OPACShowBarcode ) %]<td class="barcode">[% ITEM_RESULT.barcode %]</td>[% END %] if $ccode get a warning, must also fix it. (In reply to comment #7) > (In reply to comment #6) > > In which cases do you see warning messages? > > > > On opac-detail.pl, I just get some warnings about $ccode (Use of > > uninitialized value $ccode in exists at /home/koha/src/opac/opac-detail.pl > > line 534). > > I meant that I have written the code like the other tests, for example as > the barcode code: > > [% IF ( itemdata_datedue ) %]<td class="date_due">[% ITEM_RESULT.datedue | > $KohaDates %]</td>[% END %] > [% IF ( OPACShowBarcode ) %]<td class="barcode">[% ITEM_RESULT.barcode > %]</td>[% END %] > > if $ccode get a warning, must also fix it. Since I cannot reproduce, I cannot help you. You can keep your code but if the error is caused by the KohaDates plugin you have to check the existence of the variable before filtering it : [% IF ( itemdata_datedue ) %]<td class="date_due">[% IF ITEM_RESULT.datedue%][% ITEM_RESULT.datedue | $KohaDates %][% END %]</td>[% END %] (In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #6) > > > In which cases do you see warning messages? > > > > > > On opac-detail.pl, I just get some warnings about $ccode (Use of > > > uninitialized value $ccode in exists at /home/koha/src/opac/opac-detail.pl > > > line 534). > > > > I meant that I have written the code like the other tests, for example as > > the barcode code: > > > > [% IF ( itemdata_datedue ) %]<td class="date_due">[% ITEM_RESULT.datedue | > > $KohaDates %]</td>[% END %] > > [% IF ( OPACShowBarcode ) %]<td class="barcode">[% ITEM_RESULT.barcode > > %]</td>[% END %] > > > > if $ccode get a warning, must also fix it. > > Since I cannot reproduce, I cannot help you. > You can keep your code but if the error is caused by the KohaDates plugin > you have to check the existence of the variable before filtering it : > > [% IF ( itemdata_datedue ) %]<td class="date_due">[% IF > ITEM_RESULT.datedue%][% ITEM_RESULT.datedue | $KohaDates %][% END %]</td>[% > END %] Ok, but I check the existence of the variable in [% IF ( itemdata_datedue ) %] I Would not checking the same variable two times? (In reply to comment #9) > Ok, but I check the existence of the variable in [% IF ( itemdata_datedue ) > %] > > I Would not checking the same variable two times? itemdata_datedue is true if at least one datedue is defined in the ITEM_RESULT array. It is not the same variable at all. It's true, you are right...sorry, I fix it. Created attachment 15797 [details] [review] Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt Comment on attachment 15797 [details] [review] Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt Review of attachment 15797 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ +1480,4 @@ > [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %] > <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td> > [% IF ( itemdata_itemnotes ) %]<td class="notes">[% ITEM_RESULT.itemnotes %]</td>[% END %] > + [% IF ( itemdata_datedue ) %]<td class="date_due">[% IF ITEM_RESULT.datedue %][% ITEM_RESULT.datedue | $KohaDates %]</td>[% END %] tag END missing for the first IF statement Created attachment 15799 [details] [review] Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt thanks! I don't see this error in my OPAC logs from general OPAC use. Please revise your patch to include a test plan, including steps to reproduce the error. (In reply to comment #15) > I don't see this error in my OPAC logs from general OPAC use. Please revise > your patch to include a test plan, including steps to reproduce the error. Changing status of this report to reflect the need for clarification. See above request. *** This bug has been marked as a duplicate of bug 7937 *** |