diff --git a/CHANGELOG.md b/CHANGELOG.md index e5d9826..ce96ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,22 +10,27 @@ Types of changes Security in case of vulnerabilities. ) +## [2.12.4](https://github.com/pdir/contao-webtools/tree/2.12.4) - 2023-07-31 + +- [Fixed] Fix compatibility with Codefog News Categories bundle +- [Changed] Add system log entries for better and easier debugging [#127](https://github.com/pdir/social-feed-bundle/pull/127) 🤗 [w3scout](https://github.com/w3scout) + ## [2.12.3](https://github.com/pdir/contao-webtools/tree/2.12.3) - 2023-06-27 -- [Fixed] Fix dca to make compatible with ContaoNewsBundle ^4.4 ([#94](https://github.com/pdir/social-feed-bundle/issues/94)) +- [Fixed] Fix dca to make compatible with ContaoNewsBundle ^4.4 [#94](https://github.com/pdir/social-feed-bundle/issues/94) - [Fixed] Fix error in Contao 4.4: Attempted to call function "sprintf" from namespace "Safe" ## [2.12.2](https://github.com/pdir/contao-webtools/tree/2.12.2) - 2023-06-13 -- [Fixed] Fix instagram import if post has no description ([#116](https://github.com/pdir/social-feed-bundle/issues/116)) +- [Fixed] Fix instagram import if post has no description [#116](https://github.com/pdir/social-feed-bundle/issues/116) ## [2.12.1](https://github.com/pdir/contao-webtools/tree/2.12.1) - 2023-06-09 - [Fixed] Fix error if type and access token is empty - [Fixed] Fix error if twitter access token is invalid or expired -- [Fixed] Fix Instagram import if media_url is null ([#109](https://github.com/pdir/social-feed-bundle/issues/109)) +- [Fixed] Fix Instagram import if media_url is null [#109](https://github.com/pdir/social-feed-bundle/issues/109) - [Fixed] Fix Facebook import if post has no attachments -- [Fixed] Fix Instagram account name is not displayed ([#115](https://github.com/pdir/social-feed-bundle/issues/115)) +- [Fixed] Fix Instagram account name is not displayed [#115](https://github.com/pdir/social-feed-bundle/issues/115) ## [2.12.0](https://github.com/pdir/contao-webtools/tree/2.12.0) - 2023-02-10 @@ -45,7 +50,7 @@ Types of changes - [Added] add author for new news - [Fixed] fix facebook import (if teaser or image is null) -- [Fixed] fix twitter import ([#83](https://github.com/pdir/social-feed-bundle/issues/83)) +- [Fixed] fix twitter import [#83](https://github.com/pdir/social-feed-bundle/issues/83) - [Fixed] Fix critical errors in facebook import and return error message instead - [Fixed] Fix compatibility with newest DBAL version diff --git a/src/ContaoManager/Plugin.php b/src/ContaoManager/Plugin.php index d4d1800..8e47b57 100644 --- a/src/ContaoManager/Plugin.php +++ b/src/ContaoManager/Plugin.php @@ -20,6 +20,7 @@ namespace Pdir\SocialFeedBundle\ContaoManager; +use Codefog\NewsCategoriesBundle\CodefogNewsCategoriesBundle; use Contao\CoreBundle\ContaoCoreBundle; use Contao\ManagerPlugin\Bundle\BundlePluginInterface; use Contao\ManagerPlugin\Bundle\Config\BundleConfig; @@ -38,7 +39,7 @@ public function getBundles(ParserInterface $parser) { return [ BundleConfig::create(PdirSocialFeedBundle::class) - ->setLoadAfter([ContaoCoreBundle::class]) + ->setLoadAfter([ContaoCoreBundle::class, CodefogNewsCategoriesBundle::class]) ->setReplace(['socialfeedbundle']), ]; } diff --git a/src/Dca/tl_social_feed.php b/src/Dca/tl_social_feed.php index 562ed9a..2dce99f 100644 --- a/src/Dca/tl_social_feed.php +++ b/src/Dca/tl_social_feed.php @@ -29,7 +29,7 @@ class tl_social_feed /** * social-feed-bundle version. */ - public const VERSION = '2.12.3'; + public const VERSION = '2.12.4'; /** * Template. diff --git a/src/Module/ModuleCustomNewslist.php b/src/Module/ModuleCustomNewslist.php index cf68da9..56dfea3 100644 --- a/src/Module/ModuleCustomNewslist.php +++ b/src/Module/ModuleCustomNewslist.php @@ -39,12 +39,12 @@ protected function compile(): void $this->Template->sfMasonry = $this->pdir_sf_enableMasonry; $this->Template->sfColumns = ' '.$this->pdir_sf_columns; + // only used if the contao speed bundle is installed and the js_lazyload template is activated (https://github.com/heimrichhannot/contao-speed-bundle) + $this->Template->lazyload = false; $layout = LayoutModel::findByPk($GLOBALS['objPage']->layout); if (null !== $layout->scripts && strpos($layout->scripts, 'lazyload')) { $this->Template->lazyload = true; - } else { - $this->Template->lazyload = false; } } } diff --git a/src/Module/NewsCategoriesModule.php b/src/Module/NewsCategoriesModule.php new file mode 100644 index 0000000..7711211 --- /dev/null +++ b/src/Module/NewsCategoriesModule.php @@ -0,0 +1,50 @@ + + * @author Philipp Seibt + * @author pdir GmbH + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Pdir\SocialFeedBundle\Module; + +use Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule; +use Contao\LayoutModel; + +class NewsCategoriesModule extends NewsListModule +{ + /** + * Template. + * + * @var string + */ + protected $strTemplate = 'mod_newslist'; + + protected function compile(): void + { + parent::compile(); + + $this->Template->sfMasonry = $this->pdir_sf_enableMasonry; + $this->Template->sfColumns = ' '.$this->pdir_sf_columns; + + // only used if the contao speed bundle is installed and the js_lazyload template is activated (https://github.com/heimrichhannot/contao-speed-bundle) + $this->Template->lazyload = false; + $layout = LayoutModel::findByPk($GLOBALS['objPage']->layout); + + if (null !== $layout->scripts && strpos($layout->scripts, 'lazyload')) { + $this->Template->lazyload = true; + } + } +} diff --git a/src/Resources/contao/config/config.php b/src/Resources/contao/config/config.php index 4bf1101..5e03c60 100644 --- a/src/Resources/contao/config/config.php +++ b/src/Resources/contao/config/config.php @@ -19,6 +19,7 @@ */ use Pdir\SocialFeedBundle\Module\ModuleCustomNewslist; +use Pdir\SocialFeedBundle\Module\NewsCategoriesModule; /* * Backend modules @@ -48,6 +49,10 @@ */ $GLOBALS['FE_MOD']['news']['newslist'] = ModuleCustomNewslist::class; +if (false !== strpos($GLOBALS['FE_MOD']['news']['newslist'], 'Codefog\NewsCategoriesBundle')) { + $GLOBALS['FE_MOD']['news']['newslist'] = NewsCategoriesModule::class; +} + /* * Crons */