Browse by hierarchy - Links not working
Hi. I'm trying to set up the *Browse by hierarchy* on OPAC I have 2 problems: 1 - Links don't work For example, it shows: */classification 3/* (10 biblios) Than, when I click on /classification 3/ link, it says: No results found! 2 - The *Classification* names doesn’t show I've read http://wiki.koha-community.org/wiki/Opac_browse_feature and, it says: /The browser feature will build a browsable view of your catalogue. It will, for example, tell you that your catalogue contains : 1353 biblios about “Science” 5624 biblios about “Geography” 9835 biblios about “Spirituality” / On my page it doesn’t show the name (ex: Science) but the corresponding number, like in my first problem above: Shows /"Classification 3"/ instead of /"3 SOCIAL SCIENCES"/ I know this is experimental and for French Dewey catalogue, but, can anyone please provide detailed instructions to set it up correctly and, if possible, in other systems different of French Dewey? Is there anyone with this feature working? Thank you, ----- Koha version: 3.08.04 - - José Anjos -- View this message in context: http://koha.1045719.n5.nabble.com/Browse-by-hierarchy-Links-not-working-tp57... Sent from the Koha-general mailing list archive at Nabble.com.
As no one has replied to José's mail, I put forward my own case, hoping to help us both. I have too tried setting-up "Browse by hierarchy", but - as you might guess - have encountered a problem. If all went well, I wouldn't write to the list, would I? In http://wiki.koha-community.org/wiki/Opac_browse_feature it is mentioned that "KOHA_CONF and PERL5LIB [have] to be set". I guess that KOHA_CONF and PERL5LIB are shell environment variables. In my installation they seem not to be set: koha@koha:~$ who am i koha pts/1 2012-09-16 11:05 (:0.0) koha@koha:~$ koha@koha:~$ set | grep -i koha GS_LIB=/home/koha/.fonts GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/koha/.gtkrc-2.0::/home/koha/.kde/share/config/gtkrc-2.0 GTK_RC_FILES=/etc/gtk/gtkrc:/home/koha/.gtkrc::/home/koha/.kde/share/config/gtkrc HISTFILE=/home/koha/.bash_history HOME=/home/koha HOSTNAME=koha LOGNAME=koha PWD=/home/koha QT_PLUGIN_PATH=/home/koha/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/ SESSION_MANAGER=local/koha:@/tmp/.ICE-unix/1928,unix/koha:/tmp/.ICE-unix/1928 USER=koha koha@koha:~$ koha@koha:~$ set | grep -i perl5 opt=($( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* )); koha@koha:~$ Furthermore, there is no "build_browser_and_tags.pl" in my system. There are however two copies of "build_browser_and_cloud.pl": ./home/koha/kohaclone/blib/SCRIPT_NONDEV_DIR/cronjobs/build_browser_and_cloud.pl ./home/koha/kohaclone/misc/cronjobs/build_browser_and_cloud.pl Although I knew that shell environment variables can be crucial, I thought I might try this instead, as a) the aforementioned page might have not be updated with the current filename, and b) setting-up the tag cloud would be my next goal. As expected, when I try to run build_browser_and_tags.pl, I get: root@koha:/# perl /home/koha/kohaclone/misc/cronjobs/build_browser_and_cloud.pl Can't locate C4/Koha.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /home/koha/kohaclone/misc/cronjobs/build_browser_and_cloud.pl line 13. BEGIN failed--compilation aborted at /home/koha/kohaclone/misc/cronjobs/build_browser_and_cloud.pl line 13. root@koha:/# I suppose I would get the same error messages if I could try "build_browser_and_tags.pl". Any ideas on what might have happened and/or how I might correct it? As I've mentioned in previous messages, I use a ready-made koha VM, built by Kyle Hall. It is set-up to get git updates. I'm now on v3.08.04.000, running on debian Linux koha 2.6.32-5-686 #1 SMP Kind regards, Manos Petridis -----Original Message----- From: koha-bounces@lists.katipo.co.nz [mailto:koha-bounces@lists.katipo.co.nz] On Behalf Of anjoze Sent: Wednesday, August 29, 2012 3:43 PM To: koha@lists.katipo.co.nz Subject: [Koha] Browse by hierarchy - Links not working Hi. I'm trying to set up the *Browse by hierarchy* on OPAC I have 2 problems: 1 - Links don't work For example, it shows: */classification 3/* (10 biblios) Than, when I click on /classification 3/ link, it says: No results found! 2 - The *Classification* names doesn’t show I've read http://wiki.koha-community.org/wiki/Opac_browse_feature and, it says: /The browser feature will build a browsable view of your catalogue. It will, for example, tell you that your catalogue contains : 1353 biblios about “Science” 5624 biblios about “Geography” 9835 biblios about “Spirituality” / On my page it doesn’t show the name (ex: Science) but the corresponding number, like in my first problem above: Shows /"Classification 3"/ instead of /"3 SOCIAL SCIENCES"/ I know this is experimental and for French Dewey catalogue, but, can anyone please provide detailed instructions to set it up correctly and, if possible, in other systems different of French Dewey? Is there anyone with this feature working? Thank you, ----- Koha version: 3.08.04 - - José Anjos -- View this message in context: http://koha.1045719.n5.nabble.com/Browse-by-hierarchy-Links-not-working-tp57... Sent from the Koha-general mailing list archive at Nabble.com. _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
Hi Manos Petridis. Now I can browse by hierarchy :) In my case, because we are Portuguese and work with UDC-Classification instead of Dewey-Classification it was a bit more difficult but it is solved. We use Unimarc. Because I don’t know if you work with UDC or Dewey I will give my example. 1: MAKE ZEBRA SEARCH BY UDC-Classification This explanation saved the day: http://wiki.koha-community.org/wiki/Understanding_Zebra_indexing#Another_rea... What I have done: (++ is to add) /etc/koha/zebradb/marc_defs/ccl.properties *Uncomment*: UDC-classification 1=14 /etc/koha/zebradb/marc_defs/unimarc/biblios/record.abs ++ melm 675$a UDC-classification /usr/share/koha/lib/C4/Search.pm → In: my @indexes = ( ++ 'UDC-classification', *I'm not sure about this part:* /usr/share/koha/opac/htdocs/opac-tmpl/prog/en/includes/masthead.inc /++ [% IF ( ms_UDC-classification ) %] <option selected="selected" value="UDC-classification">CDU</option> [% ELSE %] <option value="UDC-classification">CDU</option> [% END %]/ 2: BROWSE BY HIERARCHY Edit: /usr/share/koha/opac/htdocs/opac-tmpl/prog/pt-PT/modules/opac-browser.tt *Change*: a href="opac-search.pl?q=Dewey-classification: *For* : a href="opac-search.pl?q=UDC-classification: *Edit:* /usr/share/koha/bin/cronjobs/build_browser_and_cloud.pl and change to your your lang and framework field: if (C4::Context->preference('opaclanguages') =~ m/^*pt*/i && $browser_tag eq *'675'* & $browser_subfield eq *'a'*) { In the same file, build_browser_and_cloud.pl, you need to change *ALL the French classification* to yours. *It is done!!* Than just rebuild /build_browser_and_cloud.pl/ and voilá. (If it works put it in cron +/- 2 times per month ) But, there is a little issue with this, it should have right and left truncation... maybe in the next version :) Example: If you click on 322 the search will find everything with 322, in the beginning, midle or end. But you can search writing this: /UDC-classification=322 and UDC-classification,first-in-subfield=322/ This will search everything starting by 322 I steel cant get the classifications names just the numbers, but, for now, I'm happy. About your problem *Can't locate C4/Context.pm in @INC* Someone in this forum found this solution: Copying C4 directory to /etc/perl/ should solve your problem: cp -a /usr/share/koha/lib/C4/ /etc/perl/ Hope it helps, José Anjos ----- Koha version: 3.08.04 - - José Anjos -- View this message in context: http://koha.1045719.n5.nabble.com/Browse-by-hierarchy-Links-not-working-tp57... Sent from the Koha-general mailing list archive at Nabble.com.
Hi José, Thank you VERY much for your step-by-step instructions. Although I try to follow DDC in my installation, I'm sure that your guide will be soon incorporated in the pertinent wiki page. As to your suggestion regarding the *Can't locate C4/Context.pm in @INC* problem, I find two C4 folders in my installation koha@koha:/$ sudo find / -type d -name C4 -print /home/koha/kohaclone/C4 /home/koha/kohaclone/blib/PERL_MODULE_DIR/C4 a) Would you have any idea on the correct folder to use? b) Would linking (instead of copying the folder contents) suffice? Thanks again! Manos -----Original Message----- From: koha-bounces@lists.katipo.co.nz [mailto:koha-bounces@lists.katipo.co.nz] On Behalf Of anjoze Sent: Monday, September 17, 2012 1:09 AM To: koha@lists.katipo.co.nz Subject: Re: [Koha] Browse by hierarchy - Links not working Hi Manos Petridis. Now I can browse by hierarchy :) In my case, because we are Portuguese and work with UDC-Classification instead of Dewey-Classification it was a bit more ... About your problem *Can't locate C4/Context.pm in @INC* Someone in this forum found this solution: Copying C4 directory to /etc/perl/ should solve your problem: cp -a /usr/share/koha/lib/C4/ /etc/perl/ Hope it helps, José Anjos ----- Koha version: 3.08.04 - - José Anjos -- View this message in context: http://koha.1045719.n5.nabble.com/Browse-by-hierarchy-Links-not-working-tp57... Sent from the Koha-general mailing list archive at Nabble.com. _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
Hi. Looks like you have a dev install rather than a production one which is fine. So you will need to set a couple of environment variables (perhaps in your .bashrc so you get it every time): export KOHA_CONF=/home/koha/koha-dev/etc/koha-conf.xml export PERL5LIB=/home/koha/kohaclone Good luck. On 19/09/2012 22:19, Manos PETRIDIS wrote:
Hi José,
Thank you VERY much for your step-by-step instructions. Although I try to follow DDC in my installation, I'm sure that your guide will be soon incorporated in the pertinent wiki page.
As to your suggestion regarding the *Can't locate C4/Context.pm in @INC* problem, I find two C4 folders in my installation
koha@koha:/$ sudo find / -type d -name C4 -print /home/koha/kohaclone/C4 /home/koha/kohaclone/blib/PERL_MODULE_DIR/C4
a) Would you have any idea on the correct folder to use? b) Would linking (instead of copying the folder contents) suffice?
Thanks again! Manos
-----Original Message----- From: koha-bounces@lists.katipo.co.nz [mailto:koha-bounces@lists.katipo.co.nz] On Behalf Of anjoze Sent: Monday, September 17, 2012 1:09 AM To: koha@lists.katipo.co.nz Subject: Re: [Koha] Browse by hierarchy - Links not working
Hi Manos Petridis.
Now I can browse by hierarchy :) In my case, because we are Portuguese and work with UDC-Classification instead of Dewey-Classification it was a bit more
...
About your problem *Can't locate C4/Context.pm in @INC* Someone in this forum found this solution: Copying C4 directory to /etc/perl/ should solve your problem: cp -a /usr/share/koha/lib/C4/ /etc/perl/
Hope it helps, José Anjos
----- Koha version: 3.08.04 - - José Anjos -- View this message in context: http://koha.1045719.n5.nabble.com/Browse-by-hierarchy-Links-not-working-tp57... Sent from the Koha-general mailing list archive at Nabble.com. _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- Ian Bays Director of Projects, PTFS Europe Limited Content Management and Library Solutions +44 (0) 800 756 6803 (phone) +44 (0) 7774 995297 (mobile) +44 (0) 800 756 6384 (fax) skype: ian.bays email: ian.bays@ptfs-europe.com
Thank you both Ian and Paul for your prompt help! It still doesn't work, but I have made some progress: I noticed that the @INC contained the "." at the end, so I searched for the locations where "C4/Koha.pm" would be a correct, existing filename. They were two: -rw-r--r-- 1 root root 37123 Jul 20 16:46 /home/koha/kohaclone/C4/Koha.pm -r--r--r-- 1 koha koha 37381 Nov 29 2011 /home/koha/kohaclone/blib/PERL_MODULE_DIR/C4/Koha.pm There is also a -rw-r--r-- 1 koha koha 963 Nov 29 2011 /home/koha/kohaclone/t/db_dependent/lib/KohaTest/Koha.pm But it doesn't reside within a C4 folder. When I run the script from a "correct" directory (/home/koha/kohaclone) it only complaints that it is "unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 360.". I find three koha-conf.xml files in my installation: -r--r--r-- 1 koha koha 12135 Aug 19 07:41 /home/koha/kohaclone/blib/KOHA_CONF_DIR/koha-conf.xml -rw-r--r-- 1 koha koha 12135 Nov 29 2011 /home/koha/koha-dev/etc/koha-conf.xml -rw-r--r-- 1 root root 12100 Aug 12 14:58 /home/koha/kohaclone/etc/koha-conf.xml What is each file for? Judging by the permissions and the modification date, the "live" configuration file should be the one at /home/koha/kohaclone/etc while the one at /home/koha/kohaclone/blib/KOHA_CONF_DIR could perhaps be the one that comes with each new version? On the other hand, the contents of the first file seem more to be configuration values, while the latter seem to refer to values set elsewhere. In any case I now know that I have a developer installation, so that I may seek the correct documentation. Best regards, Manos -----Original Message----- From: koha-bounces@lists.katipo.co.nz [mailto:koha-bounces@lists.katipo.co.nz] On Behalf Of Ian Bays Sent: Thursday, September 20, 2012 1:35 AM To: koha@lists.katipo.co.nz Subject: Re: [Koha] Browse by hierarchy - Links not working Hi. Looks like you have a dev install rather than a production one which is fine. So you will need to set a couple of environment variables (perhaps in your .bashrc so you get it every time): export KOHA_CONF=/home/koha/koha-dev/etc/koha-conf.xml export PERL5LIB=/home/koha/kohaclone Good luck. On 19/09/2012 22:19, Manos PETRIDIS wrote:
Hi José,
Thank you VERY much for your step-by-step instructions. Although I try to follow DDC in my installation, I'm sure that your guide will be soon incorporated in the pertinent wiki page.
As to your suggestion regarding the *Can't locate C4/Context.pm in @INC* problem, I find two C4 folders in my installation
koha@koha:/$ sudo find / -type d -name C4 -print /home/koha/kohaclone/C4 /home/koha/kohaclone/blib/PERL_MODULE_DIR/C4
a) Would you have any idea on the correct folder to use? b) Would linking (instead of copying the folder contents) suffice?
Thanks again! Manos
-----Original Message----- From: koha-bounces@lists.katipo.co.nz [mailto:koha-bounces@lists.katipo.co.nz] On Behalf Of anjoze Sent: Monday, September 17, 2012 1:09 AM To: koha@lists.katipo.co.nz Subject: Re: [Koha] Browse by hierarchy - Links not working
Hi Manos Petridis.
Now I can browse by hierarchy :) In my case, because we are Portuguese and work with UDC-Classification instead of Dewey-Classification it was a bit more
...
About your problem *Can't locate C4/Context.pm in @INC* Someone in this forum found this solution: Copying C4 directory to /etc/perl/ should solve your problem: cp -a /usr/share/koha/lib/C4/ /etc/perl/
Hope it helps, José Anjos
----- Koha version: 3.08.04 - - José Anjos -- View this message in context: http://koha.1045719.n5.nabble.com/Browse-by-hierarchy-Links-not-workin g-tp5724658p5726924.html Sent from the Koha-general mailing list archive at Nabble.com. _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- Ian Bays Director of Projects, PTFS Europe Limited Content Management and Library Solutions +44 (0) 800 756 6803 (phone) +44 (0) 7774 995297 (mobile) +44 (0) 800 756 6384 (fax) skype: ian.bays email: ian.bays@ptfs-europe.com _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
Greetings, DISCLAIMER: THIS FEEDBACK DOES NOT APPLY TO EVERYONE, PLEASE DON'T JUST TRY THIS BECAUSE YOU HAVE A PROBLEM.
About your problem *Can't locate C4/Context.pm in @INC* Someone in this forum found this solution: Copying C4 directory to /etc/perl/ should solve your problem: cp -a /usr/share/koha/lib/C4/ /etc/perl/
This is the WRONG solution. Yes, it works, but upgrading your koha in the future becomes a nightmare! There are supposed to be two environment variables defined: $KOHA_CONF $PERL5LIB If you do not have these defined, you will encounter problems running Koha scripts. (WARNING! WARNING! WARNING! I AM NOT RESPONSIBLE IF YOU DO NOT READING CAREFULLY.) *IF* (IF, IF, IF, IF, IF) PERL5LIB is not (I repeat NOT, NOT, NOT, NOT) defined at all, and given the results of your search: (DO NOT DO THIS IF PERL5LIB IS DEFINED, BECAUSE YOU COULD BREAK SOMETHING ELSE!) $ export PERL5LIB=/home/koha/kohaclone Follow up questions: If you have a kohaclone directory, how did you answer the build questions? If you didn't build this, and it is a virtual machine image, ask the provider of that image. One potential workaround, if your system is a koha only system: Under Ubuntu, and perhaps other debian-based OSes (though I haven't tested them) you can add to the bottom of /etc/environment (as root): PERL5LIB=/home/koha/kohaclone Log out, and log back in, and this will be set for EVERY user on the system. This is only a good solution if the system is a koha only system. Otherwise, you will need to modify appropriate rc shell scripts in particular users home directories to set it. GPML, Mark Tompsett
Thank you Mark for the warning and suggestions. The truth is I've had some unix experience in the distant past; instead of copying anything, I'd link so that I could easily revert to the original state. As I've mentioned before, I use a ready-made VM, the reason that I don't ask the provider of that image directly is that his (and your) replies will be available to us all, for all current and future users of his appliance. /etc/environment is empty in my installation, I've updated /home/koha/.bashrc instead, as per Ian's instructions. Kind regards, Manos P.S. I do miss the good old unix days when all I had to check was a .profile -----Original Message----- From: Mark Tompsett [mailto:mtompset@hotmail.com] Sent: Thursday, September 20, 2012 8:30 AM To: Manos PETRIDIS; 'anjoze' Cc: koha@lists.katipo.co.nz Subject: Re: [Koha] Browse by hierarchy - Links not working Greetings, DISCLAIMER: THIS FEEDBACK DOES NOT APPLY TO EVERYONE, PLEASE DON'T JUST TRY THIS BECAUSE YOU HAVE A PROBLEM.
About your problem *Can't locate C4/Context.pm in @INC* Someone in this forum found this solution: Copying C4 directory to /etc/perl/ should solve your problem: cp -a /usr/share/koha/lib/C4/ /etc/perl/
This is the WRONG solution. Yes, it works, but upgrading your koha in the future becomes a nightmare! There are supposed to be two environment variables defined: $KOHA_CONF $PERL5LIB If you do not have these defined, you will encounter problems running Koha scripts. (WARNING! WARNING! WARNING! I AM NOT RESPONSIBLE IF YOU DO NOT READING CAREFULLY.) *IF* (IF, IF, IF, IF, IF) PERL5LIB is not (I repeat NOT, NOT, NOT, NOT) defined at all, and given the results of your search: (DO NOT DO THIS IF PERL5LIB IS DEFINED, BECAUSE YOU COULD BREAK SOMETHING ELSE!) $ export PERL5LIB=/home/koha/kohaclone Follow up questions: If you have a kohaclone directory, how did you answer the build questions? If you didn't build this, and it is a virtual machine image, ask the provider of that image. One potential workaround, if your system is a koha only system: Under Ubuntu, and perhaps other debian-based OSes (though I haven't tested them) you can add to the bottom of /etc/environment (as root): PERL5LIB=/home/koha/kohaclone Log out, and log back in, and this will be set for EVERY user on the system. This is only a good solution if the system is a koha only system. Otherwise, you will need to modify appropriate rc shell scripts in particular users home directories to set it. GPML, Mark Tompsett
Manos, P.S. I do miss the good old unix days when all I had to check was a .profile I'm not entirely sure what has changed. ~/.profile is still an excellent place to store your environment variables if you use a Bourne shell derivative. Regards, Jared -- Jared Camins-Esakov Bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins@cpbibliography.com (web) http://www.cpbibliography.com/
At 09:36 PM 9/16/2012 +0300, Manos PETRIDIS wrote: [snip]
Although I knew that shell environment variables can be crucial, I thought I might try this [snip] Can't locate C4/Koha.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 [snip] Any ideas on what might have happened and/or how I might correct it?
Could you possibly try adding the env vars to /home/koha/.bashrc or /etc/bash.bashrc.local so that it includes: export PERL5LIB=/usr/share/koha/lib then reboot (log out/log in is perhaps sufficient.) I have found that this can, in some circumstances, cure the "Can't locate C4" messages. If this does not help, at least it narrows down other possibilities. Best - Paul
participants (6)
-
anjoze -
Ian Bays -
Jared Camins-Esakov -
Manos PETRIDIS -
Mark Tompsett -
Paul