I’m a new user a typo3 and I created an extension for searching shops and to show them in a map, my search system in work with a radio button filter and a search bar.
My issue is my radio buttons and my search bar are working only alone, for example when I write something and I didn’t click on a filter, or when I click on a filter and I didn’t write anything.
when I use them together they don’t work, I don’t have results, I don’t know why
there is some code :
controller :
public function listAction()
{
$get = GeneralUtility::_GET();
$results = $this->to32wContentRepository->sortByTypeTitle(
$get['tx_import_search']['redirect']['formMap'] ?? null,
$get['tx_import_search']['redirect']['search'] ?? null
);
$this->view->assign('formMap', $get['tx_import_search']['redirect']['formMap']);
$this->view->assign('search', $get['tx_import_search']['redirect']['search']);
$this->view->assign('results', $results);
}
repository :
public function sortByTypeTitle($type, $title)
{
$query = $this->createQuery();
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->setOrderings([
'title' => QueryInterface::ORDER_ASCENDING
]);
$mission = new To32wContent();
if ($type != NULL && $title != NULL) {
$mission->setDisplayType($type);
$oR = $query->logicalOr($query->like('title', '%'.$mission->getDisplayType(). '%'), $query->like('title', '%' . $title. '%'));
$query->matching($query->logicalAnd($oR, $query->like('structure_cp', '%'.$title.'%')));
} else if ($type != NULL && $title == NULL) {
$mission->setDisplayType($type);
$query->matching($query->like('title', '%'.$mission->getDisplayType(). '%'));
} else if ($title != NULL && $type == NULL) {
$query->matching($query->logicalOr($query->like('structure_cp', '%'.$title.'%'), $query->like('title', '%' . $title. '%')));
}
return $query->execute();
}
someone have an idea to how can I solve my issue please?