]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/DB/Helper/CustomVariables.pm
Typos in Doku
[kivitendo-erp.git] / SL / DB / Helper / CustomVariables.pm
index 2810c509926885bbef758b05af76fe4b08ca94b0..6ebebda418e93db1c5f7943ee1d01610f5ee1121 100644 (file)
@@ -12,7 +12,7 @@ sub import {
   my $caller_package = caller;
 
   # TODO: if module is empty, module overloading needs to take effect
-  # certain stuff may have more than one overload, odr even more than one type
+  # certain stuff may have more than one overload, or even more than one type
   defined $caller_package     or croak 'need to be included from a caller reference';
 
   $params{module}     ||= _calc_modules_from_overloads(%params) if $params{overloads};
@@ -295,7 +295,6 @@ sub make_cvar_custom_filter {
       my $conversion  = $config->type =~ m{^(?:date|timestamp)$}       ? $config->type
                       : $config->type =~ m{^(?:customer|vendor|part)$} ? 'integer'
                       : $config->type eq 'number'                      ? 'numeric'
-                      # : $config->type eq 'bool'                        ? 'boolean'
                       :                                                  '';
 
       ($query{config}, $bind_vals{config}) = Rose::DB::Object::QueryBuilder::build_select(
@@ -310,7 +309,7 @@ sub make_cvar_custom_filter {
         query_is_sql       => 1,
       );
 
-      $query{config} =~ s{ \bdefault_value\b \s*=\s* (?!'') }{default_value::${conversion} = }x if $conversion;
+      $query{config} =~ s{ (?<! NOT\( ) default_value (?! \s*is\s+not\s+null) }{default_value::${conversion}}x if $conversion;
 
       ($query{not_customized}, $bind_vals{not_customized}) = Rose::DB::Object::QueryBuilder::build_select(
         dbh          => $config->dbh,
@@ -328,7 +327,7 @@ sub make_cvar_custom_filter {
         # remove rose aliases. query builder sadly is not reentrant, and will reuse the same aliases. :(
         $query{$key} =~ s{\bt\d+(?:\.)?\b}{}g;
 
-        # manually inline the values. again, rose doen't know how to handly bind params in subqueries :(
+        # manually inline the values. again, rose doen't know how to handle bind params in subqueries :(
         $query{$key} =~ s{\?}{ $config->dbh->quote(shift @{ $bind_vals{$key} }) }xeg;
 
         $query{$key} =~ s{\n}{ }g;
@@ -359,7 +358,7 @@ __END__
 
 =head1 NAME
 
-SL::DB::Helper::CustomVariables - Mixin to provide custom variables relations
+SL::DB::Helper::CustomVariables - Mixin to provide custom variable relations
 
 =head1 SYNOPSIS