Skip to content

Commit

Permalink
fixed unserialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Feb 28, 2023
1 parent 4b44d18 commit 99c2ad1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

## [2.5.1] - 2023-02-28
- Fixed: variable not deserialized in some cases

## [2.5.0] - 2022-04-05
- Changed: reduced number of database call in list module (Attention! event details and hasDetails attribute are now callback functions as in contao core)
- Fixed: some deprecations and imports
Expand Down
11 changes: 11 additions & 0 deletions classes/EventFilterHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace HeimrichHannot\CalendarPlus;

use Contao\StringUtil;
use HeimrichHannot\Haste\Cache\FileCache;

class EventFilterHelper extends \Frontend
Expand Down Expand Up @@ -53,6 +54,8 @@ public static function getHostSelectOptions(\DataContainer $dc)
{
$arrItems = [];

$dc->objModule->cal_calendar = StringUtil::deserialize($dc->objModule->cal_calendar);

if (!is_array($dc->objModule->cal_calendar) || empty($dc->objModule->cal_calendar))
{
return $arrItems;
Expand Down Expand Up @@ -113,6 +116,8 @@ public static function getDocentSelectOptions(\DataContainer $dc)
{
$arrItems = [];

$dc->objModule->cal_calendar = StringUtil::deserialize($dc->objModule->cal_calendar);

if (!is_array($dc->objModule->cal_calendar) || empty($dc->objModule->cal_calendar))
{
return $arrItems;
Expand Down Expand Up @@ -261,6 +266,8 @@ public static function getEventTypesSelectOptions(\DataContainer $dc)
{
$arrItems = [];

$dc->objModule->cal_calendar = StringUtil::deserialize($dc->objModule->cal_calendar);

if (!is_array($dc->objModule->cal_calendar) || empty($dc->objModule->cal_calendar))
{
return $arrItems;
Expand Down Expand Up @@ -302,6 +309,8 @@ public static function getPromoterSelectOptions(\DataContainer $dc)
{
$arrItems = [];

$dc->objModule->cal_calendar = StringUtil::deserialize($dc->objModule->cal_calendar);

if (!is_array($dc->objModule->cal_calendar) || empty($dc->objModule->cal_calendar))
{
return $arrItems;
Expand Down Expand Up @@ -337,6 +346,8 @@ public static function getCitySelectOptions(\DataContainer $dc)
{
$arrItems = [];

$dc->objModule->cal_calendar = StringUtil::deserialize($dc->objModule->cal_calendar);

if (!is_array($dc->objModule->cal_calendar) || empty($dc->objModule->cal_calendar))
{
return $arrItems;
Expand Down
1 change: 1 addition & 0 deletions classes/EventsPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function getPossibleFilterOptions($objModule)
$strClass = \Module::findClass($objModule->type);

if (class_exists($strClass)) {
/** @var ModuleEventFilter $objFilterModule */
$objFilterModule = new $strClass($objModule);
$arrOptions = $objFilterModule->getFilterOptions();
}
Expand Down

0 comments on commit 99c2ad1

Please sign in to comment.