Currently using a symbolic link to link a Koha site directory inside /etc/koha/sites to somewhere else doesn't work. Koha scripts (e.g koha-list) only look for actual directory there. There is some use case where allowing symlink there would be convenient, e.g. linking to a site directory tracked with git.
Created attachment 64935 [details] [review] Allow symbolic link in /etc/koha/sites Test Plan: Before patch: 1) Create a Koha site called demo 2) mv /etc/koha/sites/demo /srv/demo 3) ln -s /srv/demo /etc/koha/sites/ 4) koha-list will not show demo as one of the site 5) koha-list --enabled will not show demo as one of the site After patch: 1) Create a Koha site called demo 2) mv /etc/koha/sites/demo /srv/demo 3) ln -s /srv/demo /etc/koha/sites/ 4) koha-list will show demo as one of the site 5) koha-list --enabled will show demo as one of the site
Please don't forget to assign your bugs to yourself :)
Had to adapt test plan, because you need to copy the script file into place. perl /home/vagrant/misc4dev/do_all_you_can_do.pl --instance test --userid admin --password admin But other than that, seems to work. -L basically says to follow symbolic links, so this doesn't break anything as far as I can tell.
Created attachment 68511 [details] [review] Bug 18913 - Allows symbolic link in /etc/koha/sites Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Thanks for signing off. And sorry that I forgot that the script has to be copied to system location first. BTW, is there a way to test Debian script directly from the git (dev) layout?
Should this be targetted for master?
Created attachment 71939 [details] [review] Bug 18913: Allow symbolic link in /etc/koha/sites This patch makes the koha-* scripts follow symbolic links when querying for Koha instances. Without it, it is not possible to define instances outside the /etc/koha/sites directory, To test: - Create a symlink in /etc/koha/sites: $ sudo ln -s /tmp /etc/koha/sites/test - Test the original is_instance function: $ . /usr/share/koha/bin/koha-functions.sh $ is_instance test && echo success || echo failure => FAIL: symlinks are not considered instance names (i.e. failure is printed) - Apply this patch - Update the koha-functions.sh file: $ perl misc4dev/cp_debian_files.pl - Test is_instance again: $ . /usr/share/koha/bin/koha-functions.sh $ is_instance test && echo success || echo failure => SUCCESS: symlinks are considered instance names (i.e. success is printed) - Sign off :-D Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Patch pushed to master for 18.05 Congratulations Pongtawat for your first patch in!
Enhancement, not backported for 17.11