Bug 9044: (follow-up) fix merge conflict typo that broke this script
[koha.git] / C4 / SQLHelper.pm
index e1cb5d0..f1fa7b5 100644 (file)
@@ -46,7 +46,7 @@ eval {
 
 BEGIN {
        # set the version for version checking
-       $VERSION = 0.5;
+    $VERSION = 3.07.00.049;
        require Exporter;
        @ISA    = qw(Exporter);
 @EXPORT_OK=qw(
@@ -248,7 +248,7 @@ Get the Primary Key field names of the table
 
 =cut
 
-sub GetPrimaryKeys($) {
+sub GetPrimaryKeys {
        my $tablename=shift;
        my $hash_columns=_get_columns($tablename);
        return  grep { $hash_columns->{$_}->{'Key'} =~/PRI/i}  keys %$hash_columns;
@@ -284,7 +284,7 @@ With
 
 =cut
 
-sub _get_columns($) {
+sub _get_columns {
     my ($tablename) = @_;
     unless ( exists( $hashref->{$tablename} ) ) {
         my $dbh = C4::Context->dbh;
@@ -314,7 +314,7 @@ If it is not for research purpose, filter primary keys
 
 =cut
 
-sub _filter_columns ($$;$) {
+sub _filter_columns {
        my ($tablename,$research, $filtercolumns)=@_;
        if ($filtercolumns){
                return (@$filtercolumns);
@@ -406,7 +406,7 @@ sub _filter_hash{
                ## supposed to be a hash of simple values, hashes of arrays could be implemented
                $filter_input->{$field}=format_date_in_iso($filter_input->{$field})
           if $columns->{$field}{Type}=~/date/ &&
-             $filter_input->{$field} !~C4::Dates->regexp("iso");
+             ($filter_input->{$field} && $filter_input->{$field} !~C4::Dates->regexp("iso"));
                my ($tmpkeys, $localvalues)=_Process_Operands($filter_input->{$field},"$tablename.$field",$searchtype,$columns);
                if (@$tmpkeys){
                        push @values, @$localvalues;