mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-12 20:49:50 +00:00
Fixing bug where sometimes key($data[0]) returned empty string instead of first key in array
This commit is contained in:
parent
a81edb6080
commit
22e36cb057
1 changed files with 4 additions and 4 deletions
|
@ -802,7 +802,7 @@ class Model extends Overloadable {
|
|||
}
|
||||
|
||||
/**
|
||||
* This function does two things:
|
||||
* This function does two things:
|
||||
*
|
||||
* 1. it scans the array $one for the primary key,
|
||||
* and if that's found, it sets the current id to the value of $one[id].
|
||||
|
@ -1043,7 +1043,7 @@ class Model extends Overloadable {
|
|||
|
||||
/**
|
||||
* Initializes the model for writing a new record, loading the default values
|
||||
* for those fields that are not defined in $data, and clearing previous validation errors.
|
||||
* for those fields that are not defined in $data, and clearing previous validation errors.
|
||||
* Especially helpful for saving data in loops.
|
||||
*
|
||||
* @param mixed $data Optional data array to assign to the model after it is created. If null or false,
|
||||
|
@ -1996,7 +1996,7 @@ class Model extends Overloadable {
|
|||
* second parameter options for finding ( indexed array, including: 'conditions', 'limit',
|
||||
* 'recursive', 'page', 'fields', 'offset', 'order')
|
||||
*
|
||||
* Eg:
|
||||
* Eg:
|
||||
* {{{
|
||||
* find('all', array(
|
||||
* 'conditions' => array('name' => 'Thomas Anderson'),
|
||||
|
@ -2567,7 +2567,7 @@ class Model extends Overloadable {
|
|||
$valid = preg_match($rule, $data[$fieldName]);
|
||||
} elseif (Configure::read('debug') > 0) {
|
||||
$error = sprintf(
|
||||
__('Could not find validation handler %s for %s', true),
|
||||
__('Could not find validation handler %s for %s', true),
|
||||
$rule,
|
||||
$fieldName
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue