Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt
Summary: uninitialized value in concatenation error in Opac-detail.tt
Status: RESOLVED DUPLICATE of bug 7937
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nuño López Ansótegui
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-08 22:19 UTC by Humberto Blanco
Modified: 2013-08-27 17:06 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
Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt (3.15 KB, patch)
2013-02-22 09:11 UTC, Nuño López Ansótegui
Details | Diff | Splinter Review
Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt (3.24 KB, patch)
2013-02-28 06:20 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt (3.80 KB, patch)
2013-03-01 10:46 UTC, Nuño López Ansótegui
Details | Diff | Splinter Review
Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt (3.81 KB, patch)
2013-03-01 11:35 UTC, Nuño López Ansótegui
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Humberto Blanco 2012-11-08 22:19:27 UTC
Version 3.8.6

The following error appears on opac-error log
[error] opac-detail.pl: Use of uninitialized value in concatenation (.) or string at /usr/share/koha386/opac/htdocs/opac-tmpl/prog/es-ES/modules/opac-detail.tt line
 494., referer: http://10.10.22.205/cgi-bin/koha/opac-search.pl?idx=kw&q=colombi
a&offset=140&sort_by=relevance_dsc

Occurs when i do a search and pick in the results to view a item detail.


I review the source code but the error is in line 492 <td>[% ITEM_RESULT.datedue | $KohaDates %]</td>, in the first line  of the script appear [% USE KohaDates %] 

Any idea?
Comment 1 Katrin Fischer 2012-11-10 21:01:50 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?
Comment 2 Nuño López Ansótegui 2013-02-22 09:11:33 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2013-02-28 06:20:05 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-02-28 13:32:39 UTC
(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.
Comment 5 Nuño López Ansótegui 2013-02-28 14:26:24 UTC
(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.
Comment 6 Jonathan Druart 2013-02-28 14:40:47 UTC
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).
Comment 7 Nuño López Ansótegui 2013-03-01 07:29:39 UTC
(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.
Comment 8 Jonathan Druart 2013-03-01 09:10:58 UTC
(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 %]
Comment 9 Nuño López Ansótegui 2013-03-01 09:25:11 UTC
(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?
Comment 10 Jonathan Druart 2013-03-01 09:28:51 UTC
(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.
Comment 11 Nuño López Ansótegui 2013-03-01 09:46:49 UTC
It's true, you are right...sorry, I fix it.
Comment 12 Nuño López Ansótegui 2013-03-01 10:46:21 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2013-03-01 11:18:53 UTC
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
Comment 14 Nuño López Ansótegui 2013-03-01 11:35:49 UTC
Created attachment 15799 [details] [review]
Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt

thanks!
Comment 15 Owen Leonard 2013-03-18 16:20:09 UTC
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.
Comment 16 Marcel de Rooy 2013-04-04 12:20:23 UTC
(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.
Comment 17 Tomás Cohen Arazi 2013-08-27 17:06:42 UTC

*** This bug has been marked as a duplicate of bug 7937 ***