This commit is contained in:
Jürgen Mummert
2025-12-28 10:59:50 +01:00
parent b0337dcc6c
commit 0cf9703a9b
2 changed files with 4 additions and 6 deletions
@@ -4,7 +4,6 @@ namespace MummertMedia\ContaoMeilisearchBundle\Controller\FrontendModule;
use Contao\Config;
use Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController;
use Contao\FrontendTemplate;
use Contao\ModuleModel;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -16,11 +15,7 @@ class MeilisearchSearchController extends AbstractFrontendModuleController
ModuleModel $model,
Request $request
): Response {
// In Contao 4.13 ist $template immer FrontendTemplate
if (!$template instanceof FrontendTemplate) {
throw new \RuntimeException('Expected FrontendTemplate');
}
// Beide Template-Typen unterstützen Property-Zugriff
$template->meiliLimit = (int) ($model->meiliLimit ?: 50);
$template->meiliHost = Config::get('meilisearch_host');
$template->meiliIndex = Config::get('meilisearch_index');