fixes #6277, relaxing character length comparison for UUID

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8149 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2009-04-22 16:05:13 +00:00
parent 6e91ee7ad4
commit 0cc3d5149f

View file

@ -1210,7 +1210,7 @@ class Model extends Overloadable {
foreach ($this->_schema as $field => $properties) { foreach ($this->_schema as $field => $properties) {
if ($this->primaryKey === $field) { if ($this->primaryKey === $field) {
$fInfo = $this->_schema[$field]; $fInfo = $this->_schema[$field];
$isUUID = ($fInfo['length'] === 36 && $isUUID = ($fInfo['length'] == 36 &&
($fInfo['type'] === 'string' || $fInfo['type'] === 'binary') ($fInfo['type'] === 'string' || $fInfo['type'] === 'binary')
); );
if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) { if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) {
@ -1279,7 +1279,7 @@ class Model extends Overloadable {
)); ));
$isUUID = !empty($this->{$join}->primaryKey) && ( $isUUID = !empty($this->{$join}->primaryKey) && (
$this->{$join}->_schema[$this->{$join}->primaryKey]['length'] === 36 && ( $this->{$join}->_schema[$this->{$join}->primaryKey]['length'] == 36 && (
$this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'string' || $this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'string' ||
$this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'binary' $this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'binary'
) )