Skip to content

Commit

Permalink
fixed namespace issus with slick bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Feb 8, 2023
1 parent 909e64b commit d5ff4ed
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.

## [2.1.1] - 2023-02-08
- Fixed: slick bundle compatibility

## [2.1.0] - 2022-08-24
- Added: support for newer banner version and drop support for older ones ([#14])
- Changed: minumum contao version is now 4.9
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"heimrichhannot/contao-mediaquery": "^1.1",
"heimrichhannot/contao-utils-bundle": "^2.218"
},
"conflict": {
"heimrichhannot/contao-slick-bundle": "<1.8.2"
},
"autoload": {
"psr-4": {
"HeimrichHannot\\BannerPlusBundle\\": "src/"
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/CompileSlickNewsListListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Contao\FrontendTemplate;
use Contao\ModuleModel;
use HeimrichHannot\BannerPlusBundle\Template\SlickBannerTemplate;
use HeimrichHannot\SlickBundle\ModuleSlickNewsList;
use HeimrichHannot\SlickBundle\Module\ModuleSlickNewsList;

class CompileSlickNewsListListener
{
Expand Down
12 changes: 5 additions & 7 deletions src/EventListener/InitializeSystemListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


use Contao\CoreBundle\ServiceAnnotation\Hook;
use HeimrichHannot\SlickBundle\HeimrichHannotContaoSlickBundle;
use HeimrichHannot\UtilsBundle\Util\Utils;

/**
Expand All @@ -34,15 +35,12 @@ public function onInitializeSystem()
{
$this->addBackendAssets();

if (class_exists('HeimrichHannot\SlickBundle\HeimrichHannotContaoSlickBundle')) {
if (class_exists(HeimrichHannotContaoSlickBundle::class)) {
$GLOBALS['TL_HOOKS']['compileSlickNewsList']['huh_banner_plus'] = [CompileSlickNewsListListener::class, 'onCompileSlickNewsList'];
}
if(isset($GLOBALS['TL_HOOKS']['replaceInsertTags']) && is_array($GLOBALS['TL_HOOKS']['replaceInsertTags']))
{
foreach($GLOBALS['TL_HOOKS']['replaceInsertTags'] as $key => $arrConfig)
{
if($arrConfig[0] == 'BugBuster\Banner\BannerInsertTag')
{
if (isset($GLOBALS['TL_HOOKS']['replaceInsertTags']) && is_array($GLOBALS['TL_HOOKS']['replaceInsertTags'])) {
foreach ($GLOBALS['TL_HOOKS']['replaceInsertTags'] as $key => $arrConfig) {
if ($arrConfig[0] == 'BugBuster\Banner\BannerInsertTag') {
$GLOBALS['TL_HOOKS']['replaceInsertTags'][$key] = [ReplaceInsertTagsListener::class, 'onReplaceInsertTags'];
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Template/SlickBannerTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
use Contao\Module;
use Contao\ModuleModel;
use HeimrichHannot\BannerPlusBundle\Helper\SliderDisplayFormatHelper;
use HeimrichHannot\SlickBundle\ModuleSlickEventList;
use HeimrichHannot\SlickBundle\ModuleSlickNewsList;
use HeimrichHannot\SlickBundle\Module\ModuleSlickEventList;
use HeimrichHannot\SlickBundle\Module\ModuleSlickNewsList;

/**
* Class SlickBannerGenerator
Expand Down

0 comments on commit d5ff4ed

Please sign in to comment.