Skip to content

Commit

Permalink
Use underscored var names
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 17, 2023
1 parent 6ba5ee1 commit 049db99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Action/LookupAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ protected function _getFindConfig(): array
$columns = $this->_table()->getSchema()->columns();
$config = (array)$this->getConfig('findConfig');

$idField = $request->getQuery('keyField') ?: $request->getQuery('id');
$idField = $request->getQuery('key_field') ?: $request->getQuery('id');
if (in_array($idField, $columns)) {
$config['keyField'] = $idField;
}

$valueField = $request->getQuery('valueField') ?: $request->getQuery('value');
$valueField = $request->getQuery('value_field') ?: $request->getQuery('value');
if (in_array($valueField, $columns)) {
$config['valueField'] = $valueField;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Action/LookupActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function () {
'3rd post' => '3',
];

$this->get('/blogs/lookup.json?keyField=name&valueField=id');
$this->get('/blogs/lookup.json?key_field=name&value_field=id');
$this->assertEvents(['beforeLookup', 'afterLookup', 'beforeRender']);
$this->assertNotNull($this->viewVariable('viewVar'));
$this->assertNotNull($this->viewVariable('blogs'));
Expand Down

0 comments on commit 049db99

Please sign in to comment.