[Koha] OPAC Search Error in KOHA 1711.0001

Campbell, Colin colin.campbell at ptfs-europe.com
Fri Dec 29 05:03:48 NZDT 2017


Found another scenario causing this bug. GetItemTypesCategorized returns
itemtypes and searchcategories. (previously only itemtypes were returned by
the now replaced routine). If a searchcategory is used and there is not an
itemtype with the samename the find returns no object, triggering the error.

On 26 December 2017 at 20:57, Jonathan Druart <
jonathan.druart at bugs.koha-community.org> wrote:

> If you have technical skills you can try to add this line:
>
> @ opac-search.pl:229 @ my $itemtypes = GetItemTypesCategorized;
>  # add translated_description to itemtypes
>  foreach my $itemtype ( keys %{$itemtypes} ) {
>      # Itemtypes search categories don't have (yet) translated
> descriptions, they are auth values (and could still have no descriptions
> too BZ 18400)
> +    warn $itemtype;
>      my $translated_description = Koha::ItemTypes->find( $itemtype
> )->translated_description;
>      $itemtypes->{$itemtype}->{translated_description} =
> $translated_description || $itemtypes->{$itemtype}->{description} || q{};
>  }
>
> Then restart plack, reload the page and look at the Koha logs.
> It will display the different item types of the search result, the one just
> before the error is the one that is not defined in Koha.
>
> On Tue, 26 Dec 2017 at 17:37 Mubassir Ahsan <mahsandu at gmail.com> wrote:
>
> > Dear Jonathan,
> > Thanks for the reply. I have executed the query and manually search in
> the
> > database for missing itemtype and then fix all, but the problem is still
> > there.
> >
> > only Disabling the lines makes searching possible.
> >
> >
> > On Wed, Dec 27, 2017 at 1:42 AM Jonathan Druart <
> > jonathan.druart at bugs.koha-community.org> wrote:
> >
> >> Hello,
> >>
> >> Yes, it's a bug and a configuration issue.
> >> It means you have item types that are used in your catalogue but not
> >> defined in Koha.
> >>
> >> There was a discussion on koha-devel in July:
> >> http://lists.koha-community.org/pipermail/koha-devel/2017-
> July/043841.html
> >>
> >> To know the item types that are not defined in Koha, you can execute the
> >> following query:
> >> If item-level_itypes is "specific item"
> >>    select distinct(itype) from items left join itemtypes on
> >> itype=itemtype where itemtype is null;
> >> If item-level_itypes is "biblio record"
> >>   select distinct(bi.itemtype) from biblioitems bi left join itemtypes
> it
> >> on bi.itemtype=it.itemtype where bi.itemtype is null;
> >>
> >> It is a bug in the sense that Koha should not crash brutally in that
> >> case. We should at least display a warning on the about page.
> >>
> >> Regards,
> >> Jonathan
> >>
> >> On Tue, 26 Dec 2017 at 15:49 Mubassir Ahsan <mahsandu at gmail.com> wrote:
> >>
> >>> I have got a serious problem after upgrading to the latest version
> today.
> >>> The problem is when I search in OPAC search interface it is returning
> >>> "Can't call method "translated_description" on an undefined value at
> >>> /usr/share/koha/opac/cgi-bin/opac/opac-search.pl line 229."
> >>>
> >>> I have cleaned the previous 1711 version and reinstall, but still no
> >>> luck.
> >>> Please help . I am attaching screenshot to better understand.
> >>>
> >>>
> >>> --
> >>>
> >>> *Best wishes.*
> >>> *--------------------*
> >>>
> >>>
> >>>
> >>> *Md. Mubassir AhsanAssistant Librarian(Library In-Charge)Southeast
> >>> University*
> >>>
> >>> *-----------------------------*
> >>> *Mobile+Viber+IMO: 01916303060 <01916-303060>*
> >>> *Facebook:* mmahsan <http://facebook.com/mmahsan>
> >>> *Skype+Twitter*: mahsandu
> >>> Website: Mubassir.info
> >>> *"Proud to be a LIS Professional*"
> >>> *Tag: Web Developer, CMS (Drupal, Joomla), ILS (Koha), IR (DSpace,
> >>> Greenstone), N/W Admin, DBA.*
> >>> _______________________________________________
> >>> Koha mailing list  http://koha-community.org
> >>> Koha at lists.katipo.co.nz
> >>> https://lists.katipo.co.nz/mailman/listinfo/koha
> >>>
> >> --
> >
> > *Best wishes.*
> > *--------------------*
> >
> >
> >
> > *Md. Mubassir AhsanAssistant Librarian(Library In-Charge)Southeast
> > University*
> >
> > *-----------------------------*
> > *Mobile+Viber+IMO: 01916303060*
> > *Facebook:* mmahsan <http://facebook.com/mmahsan>
> > *Skype+Twitter*: mahsandu
> > Website: Mubassir.info
> >
> >
> > *"Proud to be a LIS Professional*"
> > *Tag: Web Developer, CMS (Drupal, Joomla), ILS (Koha), IR (DSpace,
> > Greenstone), N/W Admin, DBA.*
> >
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> https://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list