mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
d5ebd2f4b7
commit
9bdd3cf9aa
2 changed files with 8 additions and 3 deletions
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue