Skip to content

Commit

Permalink
Fixed an issue that page metadata wasn't changed for event detail pages
Browse files Browse the repository at this point in the history
Fixed an issue generating tag lists by category
  • Loading branch information
hschottm committed Dec 20, 2022
1 parent 006fef7 commit d9e1700
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
3 changes: 3 additions & 0 deletions modules/ModuleEventReaderTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace Contao;

use Contao\CoreBundle\Exception\InternalServerErrorException;
use Contao\CoreBundle\Exception\PageNotFoundException;
use Contao\CoreBundle\Exception\RedirectResponseException;
use Contao\CoreBundle\Routing\ResponseContext\HtmlHeadBag\HtmlHeadBag;

/**
* Contao Open Source CMS - tags extension
Expand Down
28 changes: 20 additions & 8 deletions modules/ModuleTagListByCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public function generate()
return $objTemplate->parse();
}
if (strlen($this->tag_sourcetables)) $this->sourcetables = deserialize($this->tag_sourcetables, TRUE);

array_push($this->arrPages, $this->pagesource);
$this->getRelevantPages($this->pagesource);
// $this->getTags();
return parent::generate();
}

Expand Down Expand Up @@ -102,18 +101,31 @@ protected function compile()
switch ($sourcetable)
{
case 'tl_news':
$this->Template->news = $this->getNewsForNewsTags($tagid_cats[$sourcetable]);
if (array_key_exists($sourcetable, $tagid_cats)) {
$this->Template->news = $this->getNewsForNewsTags($tagid_cats[$sourcetable]);
} else {
$this->Template->news = array();
}
break;
case 'tl_calendar_events':
$this->Template->events = $this->getEventsForEventTags($tagid_cats[$sourcetable]);
if (array_key_exists($sourcetable, $tagid_cats)) {
$this->Template->events = $this->getEventsForEventTags($tagid_cats[$sourcetable]);
} else {
$this->Template->events = array();
}
break;
case 'tl_content':
$pages = array_merge($pages, $this->getPagesForContentTags($tagid_cats[$sourcetable]));
// $this->Template->contentElements = $this->getContentElementsForContentTags($tagid_cats[$sourcetable]);
if (array_key_exists($sourcetable, $tagid_cats)) {
$pages = array_merge($pages, $this->getPagesForContentTags($tagid_cats[$sourcetable]));
}
break;
case 'tl_article':
$this->Template->articles = $this->getArticlesForArticleTags($tagid_cats[$sourcetable]);
$pages = array_merge($pages, $this->getPagesForArticleTags($tagid_cats[$sourcetable]));
if (array_key_exists($sourcetable, $tagid_cats)) {
$this->Template->articles = $this->getArticlesForArticleTags($tagid_cats[$sourcetable]);
$pages = array_merge($pages, $this->getPagesForArticleTags($tagid_cats[$sourcetable]));
} else {
$this->Template->articles = array();
}
break;
default:
if (isset($GLOBALS['TL_HOOKS']['tagSourceTable']) && is_array($GLOBALS['TL_HOOKS']['tagSourceTable'])) {
Expand Down

0 comments on commit d9e1700

Please sign in to comment.