Skip to content

Commit

Permalink
Merge pull request #31 from ggoffy/master
Browse files Browse the repository at this point in the history
fixed bug when updating event by webmaster
  • Loading branch information
ggoffy authored Mar 25, 2022
2 parents df1f386 + 3f152f0 commit b1c18c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions admin/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -154,10 +154,13 @@
$uploaderErrors .= '<br>' . $uploader->getErrors();
}
} else {
if ($filename > '') {
if ('' != $filename) {
$uploaderErrors .= '<br>' . $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');
Expand Down
5 changes: 4 additions & 1 deletion event.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@
if ($filename > '') {
$uploaderErrors .= '<br>' . $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');
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/wgevents_admin_event.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<td class='center'><{$event.catname}></td>
<td class='center'><{$event.identifier}></td>
<td class='center'><{$event.name}></td>
<td class='center'><img src="<{$wgevents_upload_eventlogos_url_uid|default:false}>/<{$event.logo}>" alt="events" style="max-width:100px" ></td>
<td class='center'><img src="<{$wgevents_upload_eventlogos_url|default:false}><{$event.submitter}>/<{$event.logo}>" alt="events" style="max-width:100px" ></td>
<td class='center'><{$event.desc_short_admin}></td>
<td class='center'><{$event.datefrom_text}></td>
<td class='center'><{$event.dateto_text}></td>
Expand Down

0 comments on commit b1c18c0

Please sign in to comment.