"Where:" label and event links displaying when empty
-
In this bug, when the Location field is left empty, the “Where:” line is still shown on the front-end. The same bug applies to a scenario where the “More Information” link is shown, even when the Event URL is left empty.
This problem applies to the if and elseif statements on lines 785, 787, 795, and specifically to your use of isset()
By comparing with isset(), it’s always returning true, because the field IS set (just null). You need to include a second comparison after ensuring the field isset, to make sure the field is not blank (even though the variable is set).
if(isset($event[‘event_url’])) { … } else…
Just check to make sure it’s not empty:
if(isset($event[‘event_url’]) && $event[‘event_url’] != ” ) {…
This example shows from line 795 but the same case applies above on 785 & 787 for location (“Where”)
https://www.ads-software.com/extend/plugins/simple-events-calendar/
- The topic ‘"Where:" label and event links displaying when empty’ is closed to new replies.