Skip to content

Commit

Permalink
Merge pull request #3 from tagconcierge/release/1.0.3
Browse files Browse the repository at this point in the history
Release/1.0.3
  • Loading branch information
mfrankiewicz authored Apr 19, 2024
2 parents 0ca48b4 + 902fc2c commit cf9c2db
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 4 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.0.3] - 2024-04-19

### Added

### Changed
* Consent Banner library upgraded to version 1.1.0

### Fixed
* issue with plugin upgrading, now hooks are refreshed during upgrade

## [1.0.2] - 2024-04-12

### Added
Expand All @@ -9,7 +19,7 @@ All notable changes to this project will be documented in this file.
* project structure optimization

### Fixed
* fixed issue with conflicting PrestaShop theme stylesheets
* issue with conflicting PrestaShop theme stylesheets

## [1.0.1] - 2024-03-26

Expand Down
2 changes: 1 addition & 1 deletion gtmconsentmodebannerfree.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct()
{
$this->name = 'gtmconsentmodebannerfree';
$this->author = 'Tag Concierge';
$this->version = '1.0.2';
$this->version = '1.0.3';
$this->ps_versions_compliancy = ['min' => '1.7.1.0', 'max' => _PS_VERSION_];
$this->bootstrap = true;
$this->tab = 'advertising_marketing';
Expand Down
4 changes: 2 additions & 2 deletions src/Hook/AssetsHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public function loadAssets(): void

$this->getContext()->controller->registerJavascript(
'tag-concierge-consent-mode-banner',
'https://public-assets.tagconcierge.com/cookies-banner-js/1.0.0/consent-banner.min.js',
'https://public-assets.tagconcierge.com/consent-banner/1.1.0/cb.min.js',
['server' => 'remote', 'position' => 'head', 'priority' => 20]
);

$this->getContext()->controller->registerStylesheet(
'tag-concierge-consent-mode-banner',
'https://public-assets.tagconcierge.com/cookies-banner-js/1.0.0/styles/light.css',
'https://public-assets.tagconcierge.com/consent-banner/1.1.0/styles/light.css',
['server' => 'remote', 'position' => 'head', 'priority' => 20]
);
}
Expand Down
14 changes: 14 additions & 0 deletions src/Install/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function uninstall(TagConciergeModuleInterface $module): bool
return true;
}

public function resetHooks(TagConciergeModuleInterface $module): bool
{
return $this->unregisterHooks($module) && $this->registerHooks($module);
}

private function registerHooks(TagConciergeModuleInterface $module): bool
{
foreach ($module->getHooks() as $hook) {
Expand All @@ -54,4 +59,13 @@ private function registerHooks(TagConciergeModuleInterface $module): bool

return true;
}

private function unregisterHooks(TagConciergeModuleInterface $module): bool
{
foreach ($module->getHooks() as $hook) {
$module->unregisterHook($hook);
}

return true;
}
}
7 changes: 7 additions & 0 deletions src/Install/ModuleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public function uninstall(): bool
return $installer->uninstall($this);
}

public function resetHooks(): bool
{
$installer = InstallerFactory::create();

return $installer->resetHooks($this);
}

/**
* @throws \SmartyException
*/
Expand Down
10 changes: 10 additions & 0 deletions upgrade/Upgrade-1.0.3.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

if (!defined('_PS_VERSION_')) {
exit;
}

function upgradeModule103(GtmConsentModeBannerFree $module): bool
{
return $module->resetHooks();
}

0 comments on commit cf9c2db

Please sign in to comment.