mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Removing redundant call to DboSource::fields(), the fields come already quoted from DboSource::read()
This commit is contained in:
parent
ad28228495
commit
b603232aee
2 changed files with 2 additions and 2 deletions
|
@ -1460,7 +1460,7 @@ class DboSource extends DataSource {
|
||||||
$queryData['fields'] = $this->fields($model, $modelAlias);
|
$queryData['fields'] = $this->fields($model, $modelAlias);
|
||||||
} elseif (!empty($model->hasMany) && $model->recursive > -1) {
|
} elseif (!empty($model->hasMany) && $model->recursive > -1) {
|
||||||
$assocFields = $this->fields($model, $modelAlias, array("{$modelAlias}.{$model->primaryKey}"));
|
$assocFields = $this->fields($model, $modelAlias, array("{$modelAlias}.{$model->primaryKey}"));
|
||||||
$passedFields = $this->fields($model, $modelAlias, $queryData['fields']);
|
$passedFields = $queryData['fields'];
|
||||||
if (count($passedFields) === 1) {
|
if (count($passedFields) === 1) {
|
||||||
if (strpos($passedFields[0], $assocFields[0]) === false && !preg_match('/^[a-z]+\(/i', $passedFields[0])) {
|
if (strpos($passedFields[0], $assocFields[0]) === false && !preg_match('/^[a-z]+\(/i', $passedFields[0])) {
|
||||||
$queryData['fields'] = array_merge($passedFields, $assocFields);
|
$queryData['fields'] = array_merge($passedFields, $assocFields);
|
||||||
|
|
|
@ -1609,7 +1609,7 @@ class DboMysqlTest extends CakeTestCase {
|
||||||
$this->_buildRelatedModels($this->Model);
|
$this->_buildRelatedModels($this->Model);
|
||||||
|
|
||||||
$binding = array('type' => 'hasMany', 'model' => 'TestModel6');
|
$binding = array('type' => 'hasMany', 'model' => 'TestModel6');
|
||||||
$queryData = array('fields' => array('MIN(TestModel5.test_model4_id)'));
|
$queryData = array('fields' => array('MIN(`TestModel5`.`test_model4_id`)'));
|
||||||
$resultSet = null;
|
$resultSet = null;
|
||||||
$null = null;
|
$null = null;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue