diff --git a/system/modules/isotope/docs/CHANGELOG-2.2.md b/system/modules/isotope/docs/CHANGELOG-2.2.md index 7be6ea8011..82320c1227 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.2.md +++ b/system/modules/isotope/docs/CHANGELOG-2.2.md @@ -4,6 +4,9 @@ Isotope eCommerce Changelog Version 2.2.3-stable (2015-??-??) --------------------------------- +### Improved +- Only generate messages module if necessary (fixes #1374) + ### Fixed - Gallery watermark positions were not available in Contao 3.4 (#1365) - Labels for foreignKey fields were not shown in product attribute view (#1389) diff --git a/system/modules/isotope/library/Isotope/Message.php b/system/modules/isotope/library/Isotope/Message.php index b44ad465a6..8c3b50ccce 100644 --- a/system/modules/isotope/library/Isotope/Message.php +++ b/system/modules/isotope/library/Isotope/Message.php @@ -96,6 +96,10 @@ public static function add($strMessage, $strType) */ public static function generate() { + if (static::isEmpty()) { + return ''; + } + $objModule = new Messages(new \ModuleModel()); $objModule->type = 'iso_message'; @@ -158,6 +162,21 @@ public static function reset() } } + /** + * Returns true if there are no messages defined + * + * @return bool + */ + public static function isEmpty() + { + foreach (static::getTypes() as $strType) { + if (!empty($_SESSION[$strType])) { + return false; + } + } + + return true; + } /** * Return all available message types