fixed an issue when default argument name is column name

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8391 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
mosmartin 2011-05-23 08:42:16 +00:00
parent a8bed44a83
commit abba8761cc
4 changed files with 6 additions and 2 deletions

View file

@ -34,7 +34,7 @@
if(!isset($this->value)) return;
if($column_type === '') return;
//if($column_type === '') $column_type = 'varchar';
if(in_array($column_type, array('date', 'varchar', 'char')))
if(in_array($column_type, array('date', 'varchar', 'char', 'bigtext')))
$this->value = '\''.$this->value.'\'';
}

View file

@ -17,6 +17,8 @@
}
if(!$this->argument_name) $this->argument_name = $tag->attrs->name;
if(!$this->argument_name) $this->argument_name = $tag->attrs->column;
require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php');
$this->argument_validator = new QueryArgumentValidator($tag);

View file

@ -14,6 +14,7 @@
function QueryArgumentValidator($tag){
$this->argument_name = $tag->attrs->var;
if(!$this->argument_name) $this->argument_name = $tag->attrs->name;
if(!$this->argument_name) $this->argument_name = $tag->attrs->column;
$this->default_value = $tag->attrs->default;
$this->notnull = $tag->attrs->notnull;
$this->filter = $tag->attrs->filter;

View file

@ -22,8 +22,9 @@
$this->operation = $condition->attrs->operation;
$this->pipe = $condition->attrs->pipe;
$this->column_name = $this->dbParser->parseColumnName($condition->attrs->column);
// TODO fix this hack - should use default value for query argument
// TODO fix this hack - argument_name is initialized in three places :) [ here, queryArgument and queryArgumentValidator]
$this->argument_name = $condition->attrs->var;
if(!$this->argument_name) $this->argument_name = $condition->attrs->column;
$this->default_column = $this->dbParser->parseColumnName($condition->attrs->default);
require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/QueryArgument.class.php');
$this->argument = new QueryArgument($condition);