Skip to content

Commit

Permalink
Filter select,auxiliary and type autoview vars by coid when needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed May 3, 2024
1 parent 42897a0 commit 5b66e8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ protected function populateAutoViewVars(object $obj=null) {
case 'select':
$avvmodel = $avv['model'];
$this->$avvmodel = TableRegistry::getTableLocator()->get($avvmodel);
if($this->$avvmodel->getSchema()->hasColumn('co_id')) {
$avv['where']['co_id'] = $this->getCOID();
}

$query = $this->$avvmodel->find($avv['type'] == 'auxiliary' ? 'all' : 'list');

if(!empty($avv['find'])) {
Expand Down

0 comments on commit 5b66e8c

Please sign in to comment.