merging fixes from [712]

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@713 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-08-25 23:23:44 +00:00
parent d5ebd2f4b7
commit 9bdd3cf9aa
2 changed files with 8 additions and 3 deletions

View file

@ -13,7 +13,7 @@
echo "<dd>".$html->linkTo($displayText, '/'.Inflector::underscore($value['controller']).'/show/'.$data[$modelName][ $field ] )."</dd>";
} else {
// this is just a plain old field.
if( isset($data[$modelName][$field]) )
if( !empty($data[$modelName][$field]) )
{
echo "<dd>".$data[$modelName][$field]."</dd>";
} else {

View file

@ -1302,12 +1302,16 @@ class Model extends Object
$merged = array_merge_recursive($data[$count],$select1);
$newdata[$count] = $merged;
unset ($select1);
//Can not find reason this was added
// If you find something comment your find
// so I can look into it more -PhpNut
//unset ($select1);
}
if(!empty($newdata[$count]))
{
$original[$count] = $newdata[$count];
}
}
$count++;
@ -1317,6 +1321,7 @@ class Model extends Object
if(!empty($original))
{
$data = $original;
}
}
@ -1514,7 +1519,7 @@ class Model extends Object
{
foreach ($this->validate as $field_name=>$validator)
{
if (!isset($data[$table][$field_name]) || !preg_match($validator, $data[$table][$field_name]))
if (isset($data[$table][$field_name]) && !preg_match($validator, $data[$table][$field_name]))
{
$errors[$field_name] = 1;
}