From 3f152f034cca10970900bea1da3897be69b53bfb Mon Sep 17 00:00:00 2001 From: ggoffy Date: Fri, 25 Mar 2022 12:30:54 +0100 Subject: [PATCH] fixed bug when updating event by webmaster --- admin/event.php | 9 ++++++--- event.php | 5 ++++- templates/admin/wgevents_admin_event.tpl | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/admin/event.php b/admin/event.php index 07b39d1..e1f5868 100644 --- a/admin/event.php +++ b/admin/event.php @@ -59,7 +59,7 @@ $GLOBALS['xoopsTpl']->assign('eventCount', $eventCount); $GLOBALS['xoopsTpl']->assign('wgevents_url', \WGEVENTS_URL); $GLOBALS['xoopsTpl']->assign('wgevents_upload_url', \WGEVENTS_UPLOAD_URL); - $GLOBALS['xoopsTpl']->assign('wgevents_upload_eventlogos_url_uid', \WGEVENTS_UPLOAD_EVENTLOGOS_URL . '/' . $uidCurrent . '/'); + $GLOBALS['xoopsTpl']->assign('wgevents_upload_eventlogos_url', \WGEVENTS_UPLOAD_EVENTLOGOS_URL . '/'); $GLOBALS['xoopsTpl']->assign('use_gmaps', $helper->getConfig('use_gmaps')); $GLOBALS['xoopsTpl']->assign('use_wggallery', $helper->getConfig('use_wggallery')); $GLOBALS['xoopsTpl']->assign('use_register', $helper->getConfig('use_register')); @@ -154,10 +154,13 @@ $uploaderErrors .= '
' . $uploader->getErrors(); } } else { - if ($filename > '') { + if ('' != $filename) { $uploaderErrors .= '
' . $uploader->getErrors(); } - $eventObj->setVar('logo', Request::getString('logo')); + $filename = Request::getString('logo'); + if ('' != $filename) { + $eventObj->setVar('logo', $filename); + } } $eventObj->setVar('desc', Request::getText('desc')); $eventDatefromArr = Request::getArray('datefrom'); diff --git a/event.php b/event.php index 796779e..36aec3e 100644 --- a/event.php +++ b/event.php @@ -258,7 +258,10 @@ if ($filename > '') { $uploaderErrors .= '
' . $uploader->getErrors(); } - $eventObj->setVar('logo', Request::getString('logo')); + $filename = Request::getString('logo'); + if ('' != $filename) { + $eventObj->setVar('logo', $filename); + } } $eventObj->setVar('desc', Request::getText('desc')); $eventDatefromArr = Request::getArray('datefrom'); diff --git a/templates/admin/wgevents_admin_event.tpl b/templates/admin/wgevents_admin_event.tpl index c6db6a9..e73ea56 100644 --- a/templates/admin/wgevents_admin_event.tpl +++ b/templates/admin/wgevents_admin_event.tpl @@ -51,7 +51,7 @@ <{$event.catname}> <{$event.identifier}> <{$event.name}> - events + events <{$event.desc_short_admin}> <{$event.datefrom_text}> <{$event.dateto_text}>