diff --git a/src/Resources/contao/config/config.php b/src/Resources/contao/config/config.php index ec6220d..63f20b3 100644 --- a/src/Resources/contao/config/config.php +++ b/src/Resources/contao/config/config.php @@ -69,25 +69,21 @@ $GLOBALS['TL_CTE']['texts']['headline'] = Hschottm\TagsBundle\ContentHeadlineTags::class; $GLOBALS['TL_CTE']['media']['gallery'] = Hschottm\TagsBundle\ContentGalleryTags::class; -// previously css and js have been added only to the backend -/* if (System::getContainer()->get('contao.routing.scope_matcher') ->isBackendRequest(System::getContainer()->get('request_stack')->getCurrentRequest() ?? Request::create('')) ) { -} -*/ - -/** - * CSS files - */ + /** + * CSS files + */ -$GLOBALS['TL_CSS'][] = 'bundles/hschottmtags/css/tag.css'; + $GLOBALS['TL_CSS'][] = 'bundles/hschottmtags/css/tag.css'; -/** - * JavaScript files - */ -$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/hschottmtags/js/tag.js'; + /** + * JavaScript files + */ + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/hschottmtags/js/tag.js'; +} /** * Hooks diff --git a/src/Resources/contao/elements/ContentGalleryTags.php b/src/Resources/contao/elements/ContentGalleryTags.php index 287c01e..111f0ac 100644 --- a/src/Resources/contao/elements/ContentGalleryTags.php +++ b/src/Resources/contao/elements/ContentGalleryTags.php @@ -79,11 +79,10 @@ protected function getFilterTags() $tags = preg_split("/,/", $this->tag_filter); $placeholders = array(); foreach ($tags as $tag) { - \array_push($placeholders, '?'); + \array_push($placeholders, "'" . $tag . "'"); } - \array_push($tags, 'tl_files'); return Database::getInstance()->prepare("SELECT tid FROM tl_tag WHERE tag IN (" . implode(',', $placeholders) . ") AND from_table = ? ORDER BY tag ASC") - ->execute($tags) + ->execute('tl_files') ->fetchEach('tid'); } else { return array(); diff --git a/src/Resources/contao/modules/ModuleCalendarTags.php b/src/Resources/contao/modules/ModuleCalendarTags.php index 8ff8adb..1a7fc48 100644 --- a/src/Resources/contao/modules/ModuleCalendarTags.php +++ b/src/Resources/contao/modules/ModuleCalendarTags.php @@ -121,11 +121,10 @@ protected function getFilterTags() $placeholders = array(); foreach ($tags as $tag) { - \array_push($placeholders, '?'); + \array_push($placeholders, "'" . $tag . "'"); } - \array_push($tags, 'tl_calendar_events'); return Database::getInstance()->prepare("SELECT tid FROM tl_tag WHERE tag IN (" . implode(',', $placeholders) . ") AND from_table = ? ORDER BY tag ASC") - ->execute($tags) + ->execute('tl_calendar_events') ->fetchEach('tid'); } else diff --git a/src/Resources/contao/modules/ModuleNewsArchiveTags.php b/src/Resources/contao/modules/ModuleNewsArchiveTags.php index af45f74..5adfa8c 100644 --- a/src/Resources/contao/modules/ModuleNewsArchiveTags.php +++ b/src/Resources/contao/modules/ModuleNewsArchiveTags.php @@ -35,11 +35,10 @@ protected function getFilterTags() $placeholders = array(); foreach ($tags as $tag) { - \array_push($placeholders, '?'); + \array_push($placeholders, "'" . $tag . "'"); } - \array_push($tags, 'tl_news'); return Database::getInstance()->prepare("SELECT tid FROM tl_tag WHERE tag IN (" . implode(',', $placeholders) . ") AND from_table = ? ORDER BY tag ASC") - ->execute($tags) + ->execute('tl_news') ->fetchEach('tid'); } else diff --git a/src/Resources/contao/modules/ModuleNewsListTags.php b/src/Resources/contao/modules/ModuleNewsListTags.php index 84cb7ae..19982bf 100644 --- a/src/Resources/contao/modules/ModuleNewsListTags.php +++ b/src/Resources/contao/modules/ModuleNewsListTags.php @@ -42,11 +42,10 @@ protected function getFilterTags() $placeholders = array(); foreach ($tags as $tag) { - \array_push($placeholders, '?'); + \array_push($placeholders, "'" . $tag . "'"); } - \array_push($tags, 'tl_news'); return Database::getInstance()->prepare("SELECT tid FROM tl_tag WHERE tag IN (" . implode(',', $placeholders) . ") AND from_table = ? ORDER BY tag ASC") - ->execute($tags) + ->execute('tl_news') ->fetchEach('tid'); } else