Error in SQL syntax when finding min/max coordinates for an empty event set

Home Forums Calendar Products Events Calendar PRO Error in SQL syntax when finding min/max coordinates for an empty event set

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1379545
    Danial Bleile
    Participant

    The 4.4.19 update appears to have refactored the handling of coordinate calculations for events and now includes a Tribe__Events__Pro__Geo_Loc::get_min_max_coords() method.

    Previously, the code in this area would only run a SQL query when it could populate a list of events to include. After the change, the SQL query runs even when the list of events is empty. This results in a query like:

    SELECT MAX( coords.lat ) [....snip....] WHERE meta_key = '_EventVenueID' AND post_id IN () ) ) AS coords

    Because no data is passed to the IN portion of that query, it generates an error.

    It looks like the code should check for an empty $event_ids_prepared before running that query. This is what we’ll do in the meantime as a hotfix at WSU.

    This is related to https://theeventscalendar.com/support/forums/topic/uncaught-typeerror-cannot-read-property-max_lat-of-null/ in that the same JavaScript error appears on the front end – Cannot read property 'max_lat' of null.

    (I would include more details with code, but this forum doesn’t seem to handle multi-line code formatting very well)

    #1381395
    Andras
    Keymaster

    Hello Jeremy,

    It looks like this is a glitch in the plugin. I have submitted a bugticket on this so our developers can take a look at it.

    Until the fix is released the workaround is to roll back to Events Calendar PRO 4.4.18.

    I am going to set the status of this ticket to “pending fix” and we will update it once the fix is released. If you have any new questions or issues please create a new ticket and reference this one.

    Thanks for your patience!

    Cheers,
    Andras

    #1436994
    Nico
    Member

    Hi there,

    Just wanted to share with you that a new maintenance release (for the Week of 7th January 2018) is out, including a fix for this issue :slightly_smiling_face:

    Find out more about this release → https://theeventscalendar.com/maintenance-release-week-7-january-2018/

    Please update the plugins and let us know if the fix works for your site,
    Best,
    Nico

    #1456308
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Error in SQL syntax when finding min/max coordinates for an empty event set’ is closed to new replies.