mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing notice errors caused by incorrect datatyping in php4.
This commit is contained in:
parent
896414e632
commit
4ada5b7eea
2 changed files with 2 additions and 2 deletions
|
@ -1884,7 +1884,7 @@ class DboSource extends DataSource {
|
|||
|
||||
if ($count >= 1 && !in_array($fields[0], array('*', 'COUNT(*)'))) {
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
if (in_array($fields[$i], $virtual)) {
|
||||
if (is_string($fields[$i]) && in_array($fields[$i], $virtual)) {
|
||||
unset($fields[$i]);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -2934,7 +2934,7 @@ class DboSourceTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testFieldsWithExpression() {
|
||||
$expression =& $this->testDb->expression("CASE Sample.id WHEN 1 THEN 'Id One' ELSE 'Other Id' END AS case_col");
|
||||
$expression = $this->testDb->expression("CASE Sample.id WHEN 1 THEN 'Id One' ELSE 'Other Id' END AS case_col");
|
||||
$result = $this->testDb->fields($this->Model, null, array("id", $expression));
|
||||
$expected = array(
|
||||
'`TestModel`.`id`',
|
||||
|
|
Loading…
Reference in a new issue