fix: [Component:CRUD] Make set quickfilter works again
Call the function with correct number of argumentpull/93/head
parent
9f7f39ec85
commit
bb9ca6e69d
|
@ -363,12 +363,6 @@ class CRUDComponent extends Component
|
|||
if (isset($params['beforeSave'])) {
|
||||
$data = $params['beforeSave']($data);
|
||||
}
|
||||
/*
|
||||
- Update meta_field table:
|
||||
- Add created and modified
|
||||
- Update meta_template_field_table:
|
||||
- Add counter column
|
||||
*/
|
||||
$savedData = $this->Table->save($data);
|
||||
if ($savedData !== false) {
|
||||
if (isset($params['afterSave'])) {
|
||||
|
@ -506,6 +500,13 @@ class CRUDComponent extends Component
|
|||
$params['contain'][] = 'Tags';
|
||||
$this->setAllTags();
|
||||
}
|
||||
if ($this->Table->hasBehavior('MetaFields')) { // TODO: check if has meta field behavior
|
||||
if (!empty($this->request->getQuery('full'))) {
|
||||
$params['contain']['MetaFields'] = ['MetaTemplateFields' => 'MetaTemplates'];
|
||||
} else {
|
||||
$params['contain'][] = 'MetaFields';
|
||||
}
|
||||
}
|
||||
|
||||
$data = $this->Table->get($id, $params);
|
||||
$data = $this->attachMetaData($id, $data);
|
||||
|
@ -804,7 +805,7 @@ class CRUDComponent extends Component
|
|||
$this->Controller->set('quickFilter', empty($quickFilterFields) ? [] : $quickFilterFields);
|
||||
if (!empty($params['quickFilter']) && !empty($quickFilterFields)) {
|
||||
$this->Controller->set('quickFilterValue', $params['quickFilter']);
|
||||
$queryConditions = $this->genQuickFilterConditions($params, $query, $quickFilterFields);
|
||||
$queryConditions = $this->genQuickFilterConditions($params, $quickFilterFields);
|
||||
$query->where(['OR' => $queryConditions]);
|
||||
} else {
|
||||
$this->Controller->set('quickFilterValue', '');
|
||||
|
|
|
@ -109,7 +109,7 @@ class MailingListsController extends AppController
|
|||
'Individuals' => function (Query $q) use ($queryParams, $quickFilter, $matchingMetaFieldParentIDs) {
|
||||
$conditions = [];
|
||||
if (!empty($queryParams)) {
|
||||
$conditions = $this->CRUD->genQuickFilterConditions($queryParams, $q, $quickFilter);
|
||||
$conditions = $this->CRUD->genQuickFilterConditions($queryParams, $quickFilter);
|
||||
}
|
||||
if (!empty($matchingMetaFieldParentIDs)) {
|
||||
$conditions[] = function (QueryExpression $exp) use ($matchingMetaFieldParentIDs) {
|
||||
|
|
Loading…
Reference in New Issue