Skip to content

Commit

Permalink
Merge pull request #128 from pdir/news-categories-compatibility
Browse files Browse the repository at this point in the history
Fix compatibility with Codefog News Categories bundle
  • Loading branch information
MDevster authored Jul 31, 2023
2 parents fd0a9c6 + de4eebb commit 10a6a2e
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 9 deletions.
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,7 +39,7 @@ public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(PdirSocialFeedBundle::class)
->setLoadAfter([ContaoCoreBundle::class])
->setLoadAfter([ContaoCoreBundle::class, CodefogNewsCategoriesBundle::class])

Check failure on line 42 in src/ContaoManager/Plugin.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\CodefogNewsCategoriesBundle not found.

Check failure on line 42 in src/ContaoManager/Plugin.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\CodefogNewsCategoriesBundle not found.

Check failure on line 42 in src/ContaoManager/Plugin.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\CodefogNewsCategoriesBundle not found.
->setReplace(['socialfeedbundle']),
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Dca/tl_social_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/Module/ModuleCustomNewslist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
50 changes: 50 additions & 0 deletions src/Module/NewsCategoriesModule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

Check failure on line 1 in src/Module/NewsCategoriesModule.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

Check failure on line 1 in src/Module/NewsCategoriesModule.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

Check failure on line 1 in src/Module/NewsCategoriesModule.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

declare(strict_types=1);

/*
* social feed bundle for Contao Open Source CMS
*
* Copyright (c) 2023 pdir / digital agentur // pdir GmbH
*
* @package social-feed-bundle
* @link https://github.com/pdir/social-feed-bundle
* @license http://www.gnu.org/licences/lgpl-3.0.html LGPL
* @author Mathias Arzberger <[email protected]>
* @author Philipp Seibt <[email protected]>
* @author pdir GmbH <https://pdir.de>
*
* 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;
}
}
}
5 changes: 5 additions & 0 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

use Pdir\SocialFeedBundle\Module\ModuleCustomNewslist;
use Pdir\SocialFeedBundle\Module\NewsCategoriesModule;

Check failure on line 22 in src/Resources/contao/config/config.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

Check failure on line 22 in src/Resources/contao/config/config.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

Check failure on line 22 in src/Resources/contao/config/config.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

/*
* Backend modules
Expand Down Expand Up @@ -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;

Check failure on line 53 in src/Resources/contao/config/config.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

Check failure on line 53 in src/Resources/contao/config/config.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.

Check failure on line 53 in src/Resources/contao/config/config.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule not found.
}

/*
* Crons
*/
Expand Down

0 comments on commit 10a6a2e

Please sign in to comment.