Fixed select bug - unless default value is explicitly set as empty string, ignore arguments whose value is empty string.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8624 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-07-22 11:50:08 +00:00
parent 8f04aa5d63
commit 7de48344cc
7 changed files with 47 additions and 21 deletions

View file

@ -5,17 +5,9 @@
var $argument_validator;
var $column_name;
var $operation;
var $ignoreValue;
function QueryArgument($tag){
// HACK (this is for backwords compatibility - there are many xml files that have variable names (var) given with .)
// eg. var = point.memeber_srl (getMemberList query from point module)
$this->argument_name = str_replace('.', '_',$tag->attrs->var);
if(!$this->argument_name) $this->ignoreValue = true;
else $this->ignoreValue = false;
$this->argument_name = $tag->attrs->var;
if(!$this->argument_name) $this->argument_name = $tag->attrs->name;
if(!$this->argument_name) $this->argument_name = str_replace('.', '_',$tag->attrs->column);
@ -28,10 +20,7 @@
}
if($tag->attrs->operation) $this->operation = $tag->attrs->operation;
// If we work with ConditionArgument, check if default value exists, and if yes, create argument
if($this->operation && $tag->attrs->default) $this->ignoreValue = false;
require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php');
$this->argument_validator = new QueryArgumentValidator($tag, $this);
@ -59,7 +48,7 @@
$arg = sprintf("\n$%s_argument = new ConditionArgument('%s', %s, '%s');\n"
, $this->argument_name
, $this->argument_name
, $this->ignoreValue ? 'null' : '$args->'.$this->argument_name
, '$args->'.$this->argument_name
, $this->operation
);
@ -67,6 +56,7 @@
$arg = sprintf("\n$%s_argument = new Argument('%s', %s);\n"
, $this->argument_name
, $this->argument_name
, '$args->'.$this->argument_name
, $this->ignoreValue ? 'null' : '$args->'.$this->argument_name);