diff --git a/dca/tl_content.php b/dca/tl_content.php index 6b55cfe..36caf67 100644 --- a/dca/tl_content.php +++ b/dca/tl_content.php @@ -133,20 +133,23 @@ public function checkFileSize(DataContainer $dc) { $pictureLeft = \FilesModel::findByUuid($dc->activeRecord->pictureLeftSRC); $pictureRight = \FilesModel::findByUuid($dc->activeRecord->pictureRightSRC); - list($pictureLeftWidth, $pictureLeftHeight) = getimagesize("../".$pictureLeft->path); - list($pictureRightWidth, $pictureRightHeight) = getimagesize("../".$pictureRight->path); - - if ($pictureLeftWidth !== $pictureRightWidth || $pictureLeftHeight !== $pictureRightHeight) { - Message::addError("Die Dimensionen (Breite, Höhe) der Bilder stimmen nicht überein!"); - $dc->activeRecord->pictureLeftSRC = null; - $dc->activeRecord->pictureRightSRC = null; - - $this->Database->query("UPDATE tl_content SET pictureLeftSRC=null, pictureRightSRC=null WHERE id=".$dc->activeRecord->id); - - unset($_POST['saveNclose']); - unset($_POST['saveNback']); - unset($_POST['saveNcreate']); - unset($_POST['saveNedit']); + if (!empty($pictureLeft) && !empty($pictureRight)) { + list($pictureLeftWidth, $pictureLeftHeight) = getimagesize("../".$pictureLeft->path); + list($pictureRightWidth, $pictureRightHeight) = getimagesize("../".$pictureRight->path); + + + if ($pictureLeftWidth !== $pictureRightWidth || $pictureLeftHeight !== $pictureRightHeight) { + Message::addError("Die Dimensionen (Breite, Höhe) der Bilder stimmen nicht überein!"); + $dc->activeRecord->pictureLeftSRC = null; + $dc->activeRecord->pictureRightSRC = null; + + $this->Database->query("UPDATE tl_content SET pictureLeftSRC=null, pictureRightSRC=null WHERE id=".$dc->activeRecord->id); + + unset($_POST['saveNclose']); + unset($_POST['saveNback']); + unset($_POST['saveNcreate']); + unset($_POST['saveNedit']); + } } } diff --git a/elements/ContentComparisonSlider.php b/elements/ContentComparisonSlider.php index 4076804..6bf8ffd 100644 --- a/elements/ContentComparisonSlider.php +++ b/elements/ContentComparisonSlider.php @@ -54,8 +54,10 @@ protected function compile() { $this->Template->classNames .= "ce_comparison-slider "; - foreach ($this->Template->classes as $class) { - $this->Template->classNames .= $class." "; + if (!empty($this->Template->classes)) { + foreach ($this->Template->classes as $class) { + $this->Template->classNames .= $class." "; + } } if (isset($this->pictureLeftSRC) && isset($this->pictureRightSRC)) {