Re: [Koha] Duplicate Biblio Records

2017-07-21 Thread Tim Young
I did make an automated script to deduplicate biblio records. Thanks, 
Joy, for the thoughts about choosing the "biggest" record. While it is 
dangerous to say it is done before the librarians have told me I did a 
great job, I will go ahead and put the script here just in case someone 
else finds it useful some day.


It does create a log file of all the biblio records it deletes. But, 
does not save the contents.  At least you can look at whatever remains 
and try to remember what the contents used to be...


My apologies to any Perl masters who might be offended by my attempt.  :)

 -

#!/usr/bin/perl
#For use with Koha 17.05.x

$INSTANCE=""; #default instance
$KOHAMYSQL="koha-mysql"; #put a path here if this cannot be found
@TABLELIST=(aqorders, article_requests, biblioimages, items, hold_fill_targets,
biblioitems, old_reserves, reserves, ratings, reviews, tags_all,
virtualshelfcontents);

my $doOne=0; #set to 1 to test
my $OutFile="DeDup_log.txt";

#
# No need to edit below this line ###
#
open(LOG,'>',$OutFile);
#read in the instance
if(@ARGV > 0) { $INSTANCE = $ARGV[0]; }
else { die "Specify a koha instance to dedup"; }

sub RunSQL
{
  my $sql = join ' ', @_;
  my $command = "echo '$sql' | $KOHAMYSQL $INSTANCE";
  my $error;
  my $out;
  print "Command: $command\n" if ($doOne == 1);
  
  $out = qx{$command 2>&1};

  $error=$?;
  return $error, $out;
}
my $counter=0;
#Find all the duplicates
print "Calculating: \n";
print LOG "Calculating: \n";
($status, $output) = RunSQL ("SELECT GROUP_CONCAT(biblionumber SEPARATOR \", \")
AS biblionumbers, title,
author FROM biblio GROUP BY CONCAT(title,\"\/\",author)
HAVING COUNT(CONCAT(title,\"\/\",author))>1;");

#Get Stats.
$dupes=0;
$totalrecs=0;

my @lines = split /\n/, $output;
foreach my $line (@lines) {
(my $nums, my $name) = split /\t/,$line;
@bibs = split /,/, $nums;
if(@bibs >1) #It is a dup if there are 2 of them.  Skip the title line
{
$dupes++;
$totalrecs+=@bibs; #count of matches
}
}
$ToRemove = $totalrecs - $dupes;
print "  Duplicates to clean: $dupes\n";
print LOG "  Duplicates to clean: $dupes\n";
print "  Total Records involved: $totalrecs\n";
print LOG "  Total Records involved: $totalrecs\n";
print "  Records to remove: $ToRemove\n";
print LOG "  Records to remove: $ToRemove\n";

#Now, we do the real work
ONETIME: {
foreach my $line (@lines) {
#print "$line\n";
(my $nums, my $name) = split /\t/,$line;
#print "  $nums\n";
@bibs = split /,/, $nums;
if(@bibs >1) #It is a dup if there are 2 of them.  Skip the title line
{
my $max=0;
my $maxitem="";
#find the biblio record with the largest size
foreach my $bib (@bibs)
{
($status, $out) = RunSQL("SELECT * FROM biblio_metadata WHERE 
biblionumber = $bib");
my $len = length($out);
if($len >= $max)
{
$max = $len;
$maxitem = $bib;
}
}

#if we have a largest size, point everything to that and delete 
other records
if($maxitem != "")
{
print LOG "---$name\n";
print LOG "Found Best Record: $maxitem\n";
my $sql;
foreach my $bib (@bibs)
{
if($bib != $maxitem) #skip the one we are standardizing on
{
#update each table
foreach my $table (@TABLELIST)
{
$sql="UPDATE $table SET biblionumber = $maxitem WHERE 
biblionumber=$bib;";
#$sql="SELECT biblionumber FROM $table WHERE 
biblionumber=$bib;";
(my $err, my $update)=RunSQL($sql);
if($err != 0)  {die $update};
}
#Now we are ready to delete
$sql = "DELETE from biblio where biblionumber = $bib;";
(my $err, my $update)=RunSQL($sql);
if($err != 0)  {die $update};
$counter++;
print LOG "  Deleting: $bib\n";
print ".";
}
}
}
if($doOne == 1) { last ONETIME; }
}
}
}
close(LOG);
print "\n";

print "Completed purging $counter records.\n";

___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha


Re: [Koha] Bulk Patron Image upload zip file giving Error 500

2017-07-21 Thread Hector Gonzalez
The problem is with the headers, the header names have whitespace before 
the text, and that became a problem after debian fixed a security bug 
related to this.


More information: https://blog.tigertech.net/posts/apache-cve-2016-8743/

Debian's fix: https://www.debian.org/security/2017/dsa-3796

In particular, the texts " extracting"  and "   inflating" have extra 
spaces before the header names.


can you check with Koha 17?

On 07/20/2017 11:29 PM, Sunil Sharma wrote:

Hello Friends,

If someone faced the problem mentioned in my previous mail attached below
and having any solution, please guide.

I am using Koha 16.05.12 with Debian 8.3 OS on my cloud server.

Currently, I am facing a very strange problem while uploading a single
patron image via Koha Bulk Patron image upload tool, the image file is
uploading fine. But When I tried using *zip file* of all patron images with
a mapped text file named as IDLINK.TXT, As soon as I browse the zip file
and try to upload the images, the images are uploaded but instead of result
page, the page will through error 500.

I had checked many Koha versions i.e. Koha 3.22.x, Koha 16.05.x, Koha
16.11.x but same *error 500* will be the result.

To troubleshoot the problem I had tested the same Koha versions with same
zip file at my local virtual machine but the strange problem which I found,
that* all Koha* versions with bulk patron upload feature *worked fine on
Debian 8.2 *but *through error 500 with Debian 8.3 and onwards i.e. 8.4,
8.8 etc. *

I had tested with different Apache versions but on Debian 8.2 all things
worked fine, but on Debian 8.3 no success (may be any security fetch or
something wrong is there)

As there are a lot of other application are running on my cloud server so I
can't change the OS. Please guide me what will I do?

The Koha error logs are as given below:





*[Thu Jul 12 13:43:02.2017] [http:error] [pid 16357] [client x.x.x.x]
AH02429: Response header name ' extracting' contains invalid characters,
aborting request, referer:
http://example.com/cgi-bin/koha/tools/picture-upload.pl
[Thu Jul 12
13:50:38.2017] [http:error] [pid 14327] [client x.x.x.x] AH02429: Response
header name '  inflating' contains invalid characters, aborting request,
referer: http://example.com/cgi-bin/koha/tools/picture-upload.pl
[Thu Jul 12
13:59:27.2017] [http:error] [pid 25507] [client x.x.x.x] AH02429: Response
header name '  inflating' contains invalid characters, aborting request,
referer: http://example.com/cgi-bin/koha/tools/picture-upload.pl
*


Any pointers would be of help.


On Fri, Jul 14, 2017 at 3:19 PM, Sunil Sharma 
wrote:


Hi Ian Bays,

Thank you very much for the valuable input.

I had checked and you are right that all patron images are uploading
correctly but was failing when trying to show the results page with the
error 500 as you observed.

Now, it is confirmed with your mail that something is wrong. Please guide
if you will find any solution for this problem.

If someone else faced this problem and having solution, please guide.



On Fri, Jul 14, 2017 at 2:19 PM, Ian Bays 
wrote:


Hello,

I have noticed the same problem uploading a zip file of patron images and
saw similar messages in the log file.

However on checking the patron records saw the images so I concluded that
the upload was working correctly but was failing when trying to show the
results page with the error 500.

There is definitely something wrong but you might like to check to see if
the upload actually worked OK.

Best regards.
Ian

On 13/07/2017 06:32, Sunil Sharma wrote:


Hello Friends,

I am using Koha 16.05.12 with Debian 8.3 OS on my cloud server.

Currently, I am facing a very strange problem while uploading a single
patron image via Koha Bulk Patron image upload tool, the image file is
uploading fine. But When I tried using *zip file* of all patron images
with
a mapped text file named as IDLINK.TXT, As soon as I browse the zip file
and try to upload the file, the page will through error 500.

I had checked many Koha versions i.e. Koha 3.22.x, Koha 16.05.x, Koha
16.11.x but same *error 500* will be the result.

To troubleshoot the problem I had tested the same Koha versions with same
zip file at my local virtual machine but the strange problem which I
found,
that* all Koha* versions with bulk patron upload feature *worked fine on
Debian 8.2 *but *through error 500 with Debian 8.3 *

I had tested with different Apache versions but on Debian 8.2 all things
worked fine, but on Debian 8.3 no success (may be any security fetch or
something wrong is there)

As there are a lot of other application are running on my cloud server
so I
can't change the OS. Please guide me what will I do?

The Koha error logs are as given below:





*[Thu Jul 12 13:43:02.2017] 

[Koha] Error borrowed book

2017-07-21 Thread Luis Moises Rojas
Hello everybody,

We got this error since one hour ago when we try to borrowed a book:
"This book could not be borrowed, belong to this library"

"El libro no puede ser prestado, pertenece a esta biblioteca"

I only need to "block" that user from another branch can not borrowed from
another branch

-- 
*Luis Moisés Rojas P.*
___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha


Re: [Koha] BANQ server returning no results

2017-07-21 Thread Philippe Blouin
You need https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11297 
then add*"@attr 4=1"* as an extra attribute to the z3950 configuration.


Any support you might give to get it to come through the approval 
process would be greatly appreicated.


Philippe Blouin,
Responsable du développement informatique

Tél.  : (888) 604-2627
philippe.blo...@inlibro.com 

inLibro | pour esprit libre | www.inLibro.com 
On 07/21/2017 01:59 PM, ILOBWeb wrote:

Hello everyone,

I have some records for resources with titles in French. When I try to add them 
through Z39.50 using BANQ server, its returning no results. However, if I 
search in BANQ's library that resource is available.

I found something related to this - 
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11297. But, I am 
unable to implement this in my Koha library.

Can anyone help me with this.

Regards,
Gurpreet

___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha


___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha


[Koha] BANQ server returning no results

2017-07-21 Thread ILOBWeb
Hello everyone,

I have some records for resources with titles in French. When I try to add them 
through Z39.50 using BANQ server, its returning no results. However, if I 
search in BANQ's library that resource is available.

I found something related to this - 
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11297. But, I am 
unable to implement this in my Koha library.

Can anyone help me with this.

Regards,
Gurpreet

___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha


[Koha] request help for bulk import of Library Books Catalog in Koha

2017-07-21 Thread Rajesh Shelar
Dear  Sir,
   I request help for bulk import of Library Books Catalog  in Koha.

Kindly guide and suggest  solutions for the following

   1. Importing Books all Feilds
   2. Preparing marc file  for our accession register attached.


I have used the following tags? Are they correct...if yes theer seems to be
a problem especially for Tag 952.
*TAG*

Accession No. 001
Barcode 952 p
Accession Date. 952 d
Author 100 $ a
Title 245 $ a
Purchase Bill NO. 024 $ a
Purchase Bill Date. 952 $ w
Page No. 300 $ a
Book Supplier 952 $ e
Book Price 952 $ g
Call No. 082 $ a
ISBN 020 $ a
Edition 250 $ a
Publication Place 260 $ a
Publisher Name 260 $ b
Book Publish Year 260 $ c
Library Shelf Location 952 $ c
Subject



*Use Of Version*

Koha version:16.05.05.000
OS version ('uname -a'):Linux koha-server 3.16.0-33-generic
#44~14.04.1-Ubuntu SMP Fri Mar 13 10:33:29 UTC 2015 x86_64
Perl interpreter:/usr/bin/perlPerl version:5.018002Perl
@INC:/usr/share/koha/lib
/etc/perl
/usr/local/lib/perl/5.18.2
/usr/local/share/perl/5.18.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.18
/usr/share/perl/5.18
/usr/local/lib/site_perl
.
MySQL version:mysql Ver 14.14 Distrib 5.5.53, for debian-linux-gnu (x86_64)
using readline 6.3Apache version:Server version: Apache/2.4.7 (Ubuntu)Zebra
version:Zebra 2.0.44 (C) 1994-2010, Index Data ApS Zebra is free software,
covered by the GNU General Public License, and you are welcome to change it
and/or distribute copies of it under certain conditions. SHA1 ID:
419ad759807269fdfa379799a051ed3a551c6541 Using ICU

I humbly request your guidance and express my gratitude in anticipation of
your help


-- 
*​**Thanks & Regards*



*Mr. Rajesh R.Shelar*
*Sadhu Vaswani Institute Of Management Studies For Girl's ( MBA )*
*Koregaon Road,Pune*
*Mob.No.8380941380*

*Save Water..Conserve Life.*
___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha


Re: [Koha] Bulk Patron Image upload zip file giving Error 500

2017-07-21 Thread Marc Véron

Hi Sunil

I have the impression that the error occurs on line 118 of picture-upload.pl

unless( system( "unzip", $tempfile, '-d', $dirname ) == 0 ) {

It seems that the zip is extracted but the program thinks that something 
went wrong with extracting and exits (following lines).


Because the error occurs since Debian 8.3 I suppose that system(...) 
returns an other value than with Debian 8.2


For the return values of system see:
http://perldoc.perl.org/functions/system.html

Just my 2 cents...

Marc


Am 21.07.2017 um 06:29 schrieb Sunil Sharma:

Hello Friends,

If someone faced the problem mentioned in my previous mail attached below
and having any solution, please guide.

I am using Koha 16.05.12 with Debian 8.3 OS on my cloud server.

Currently, I am facing a very strange problem while uploading a single
patron image via Koha Bulk Patron image upload tool, the image file is
uploading fine. But When I tried using *zip file* of all patron images with
a mapped text file named as IDLINK.TXT, As soon as I browse the zip file
and try to upload the images, the images are uploaded but instead of result
page, the page will through error 500.

I had checked many Koha versions i.e. Koha 3.22.x, Koha 16.05.x, Koha
16.11.x but same *error 500* will be the result.

To troubleshoot the problem I had tested the same Koha versions with same
zip file at my local virtual machine but the strange problem which I found,
that* all Koha* versions with bulk patron upload feature *worked fine on
Debian 8.2 *but *through error 500 with Debian 8.3 and onwards i.e. 8.4,
8.8 etc. *

I had tested with different Apache versions but on Debian 8.2 all things
worked fine, but on Debian 8.3 no success (may be any security fetch or
something wrong is there)

As there are a lot of other application are running on my cloud server so I
can't change the OS. Please guide me what will I do?

The Koha error logs are as given below:





*[Thu Jul 12 13:43:02.2017] [http:error] [pid 16357] [client x.x.x.x]
AH02429: Response header name ' extracting' contains invalid characters,
aborting request, referer:
http://example.com/cgi-bin/koha/tools/picture-upload.pl
[Thu Jul 12
13:50:38.2017] [http:error] [pid 14327] [client x.x.x.x] AH02429: Response
header name '  inflating' contains invalid characters, aborting request,
referer: http://example.com/cgi-bin/koha/tools/picture-upload.pl
[Thu Jul 12
13:59:27.2017] [http:error] [pid 25507] [client x.x.x.x] AH02429: Response
header name '  inflating' contains invalid characters, aborting request,
referer: http://example.com/cgi-bin/koha/tools/picture-upload.pl
*


Any pointers would be of help.


On Fri, Jul 14, 2017 at 3:19 PM, Sunil Sharma 
wrote:


Hi Ian Bays,

Thank you very much for the valuable input.

I had checked and you are right that all patron images are uploading
correctly but was failing when trying to show the results page with the
error 500 as you observed.

Now, it is confirmed with your mail that something is wrong. Please guide
if you will find any solution for this problem.

If someone else faced this problem and having solution, please guide.



On Fri, Jul 14, 2017 at 2:19 PM, Ian Bays 
wrote:


Hello,

I have noticed the same problem uploading a zip file of patron images and
saw similar messages in the log file.

However on checking the patron records saw the images so I concluded that
the upload was working correctly but was failing when trying to show the
results page with the error 500.

There is definitely something wrong but you might like to check to see if
the upload actually worked OK.

Best regards.
Ian

On 13/07/2017 06:32, Sunil Sharma wrote:


Hello Friends,

I am using Koha 16.05.12 with Debian 8.3 OS on my cloud server.

Currently, I am facing a very strange problem while uploading a single
patron image via Koha Bulk Patron image upload tool, the image file is
uploading fine. But When I tried using *zip file* of all patron images
with
a mapped text file named as IDLINK.TXT, As soon as I browse the zip file
and try to upload the file, the page will through error 500.

I had checked many Koha versions i.e. Koha 3.22.x, Koha 16.05.x, Koha
16.11.x but same *error 500* will be the result.

To troubleshoot the problem I had tested the same Koha versions with same
zip file at my local virtual machine but the strange problem which I
found,
that* all Koha* versions with bulk patron upload feature *worked fine on
Debian 8.2 *but *through error 500 with Debian 8.3 *

I had tested with different Apache versions but on Debian 8.2 all things
worked fine, but on Debian 8.3 no success (may be any security fetch or
something wrong is there)

As there are a lot of other application are running on my cloud server
so I
can't change the OS. Please guide me what will I 

[Koha] Delay of 16.11.10 release

2017-07-21 Thread Katrin
The release of 16.11.10 scheduled for July 22 will be delayed by a few 
days as we are waiting for some important patches to be ready and tested.


Katrin


___
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha