Home › Forums › Calendar Products › Events Calendar PRO › SQL Error and AJAX errors in Events Calendar 4.5.10 / Addons
- This topic has 8 replies, 2 voices, and was last updated 8 years, 7 months ago by
Konrad Nierwinski.
-
AuthorPosts
-
August 15, 2017 at 10:49 am #1335623
Konrad Nierwinski
ParticipantWe’re a having problems with a recurrent SQL Error related to “The Events Calendar v4.5.10” (medium) and problem with AJAX calls which start on the activation of “The Events Calendar: Community Events v4.5.4” (critical) and it is interfering with other plugins causing fails in Ajax calls.
These are debugs collected:
– – –
The Events Calendar ( 4.5.10 :: Server Console ) – Medium Error
[Tue Aug 15 13:17:39 2017] [error] [client 179.7.142.174] WordPress database error Unknown column 'greaterpocono_postmeta.meta_value' in 'field list' for query SELECT DISTINCT greaterpocono_posts.*, MIN(greaterpocono_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM greaterpocono_posts LEFT JOIN greaterpocono_term_relationships ON (greaterpocono_posts.ID = greaterpocono_term_relationships.object_id) LEFT JOIN greaterpocono_postmeta as tribe_event_end_date ON ( greaterpocono_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) WHERE 1=1 AND ( \n greaterpocono_term_relationships.term_taxonomy_id IN (25)\n) AND greaterpocono_posts.post_type = 'tribe_events' AND (greaterpocono_posts.post_status = 'publish' OR greaterpocono_posts.post_status = 'expired' OR greaterpocono_posts.post_status = 'tribe-ea-success' OR greaterpocono_posts.post_status = 'tribe-ea-failed' OR greaterpocono_posts.post_status = 'tribe-ea-schedule' OR greaterpocono_posts.post_status = 'tribe-ea-pending' OR greaterpocono_posts.post_status = 'tribe-ea-draft' OR greaterpocono_posts.post_status = 'new' OR greaterpocono_posts.post_status = 'interviewed' OR greaterpocono_posts.post_status = 'offer' OR greaterpocono_posts.post_status = 'hired' OR greaterpocono_posts.post_status = 'archived' OR greaterpocono_posts.post_status = 'private') GROUP BY greaterpocono_posts.ID ORDER BY EventStartDate DESC, greaterpocono_posts.post_date DESC LIMIT 0, 1 made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, referer: http://dev.creative-works.us:11059/w/Greater-Pocono-Chamber/– – –
The Events Calendar: Community Events ( 4.5.4 :: Browser Console ) – Critical Error
POST http://dev.creative-works.us:11059/w/Greater-Pocono-Chamber/wp-admin/admin-ajax.php 500 (Internal Server Error)– – –
The Events Calendar PRO ( 4.4.15 :: Browser Console ) – Low Error
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.August 16, 2017 at 2:12 pm #1336375Cliff
MemberHi, Konrad.
This isn’t currently a known issue so I’d suggest following these recommended troubleshooting steps for your own site:
Please follow our Testing for Conflicts Guide (basically switch to Twenty Seventeen theme and deactivate all plugins and custom code other than Modern Tribe plugins) and see if that helps narrow down the cause of this.
Of course, we always recommend restorable database and file backups before modifying anything on your site.
If it doesn’t, please enable WP_DEBUG and WP_DEBUG_LOG (which will create a file on your server at /wp-content/debug.log if there are any WP_DEBUG messages) and share any debug messages you see while trying to replicate this issue and doing other things on your site relevant to this ticket (such as visiting your site’s home page, events page, single-event pages, and anything else you can think to do).
Then, please share your System Information (while in Testing for Conflicts Mode) in a Private Reply. That will give me a lot of extra information to help troubleshoot this.
You might also see if you can spot any console errors at your site. (If needed, you may reference our KB article Using Google Chrome Developer Tools.)
Let us know what you find out.
Thanks.
August 17, 2017 at 9:59 am #1336941Konrad Nierwinski
ParticipantHi, after debug the plugin: “The Events Calendar: Community Events v4.5.4” we found the source of the problem, and it’s a logic comparison in the code located at: “…/the-events-calendar-community-events/tribe-community-events.php” line 42:
$classes_exist = class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Community__Main' );This happen because PHP 5.3 and 5.4 manage in different ways the comparison for functions, we add a temporary patch:
if (version_compare(phpversion(), '5.4', '<')) { print "[Tribe Community Events] Warning: PHP version lower than 5.4" . PHP_EOL; $classes_exist_events = class_exists( 'Tribe__Events__Main' ); $classes_exist_events_community = class_exists( 'Tribe__Events__Community__Main' ); $classes_exist = $classes_exist_events && $classes_exist_events_community; } else { $classes_exist = class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Community__Main' ); }And we wait for a official release containing the check will be released to avoid problems on future updates.
– – –
After debug the plugin: The Events Calendar v4.5.10.1 we found the source of the problem and it’s a bad implementation for SQL queries, original problematic query made by plugin:
SELECT DISTINCT greaterpocono_posts.*, MIN(greaterpocono_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM greaterpocono_posts LEFT JOIN greaterpocono_term_relationships ON (greaterpocono_posts.ID = greaterpocono_term_relationships.object_id) LEFT JOIN greaterpocono_postmeta as tribe_event_end_date ON ( greaterpocono_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) WHERE 1=1 AND (greaterpocono_term_relationships.term_taxonomy_id IN (25)) AND greaterpocono_posts.post_type = 'tribe_events' AND (greaterpocono_posts.post_status = 'publish' OR greaterpocono_posts.post_status = 'expired' OR greaterpocono_posts.post_status = 'tribe-ea-success' OR greaterpocono_posts.post_status = 'tribe-ea-failed' OR greaterpocono_posts.post_status = 'tribe-ea-schedule' OR greaterpocono_posts.post_status = 'tribe-ea-pending' OR greaterpocono_posts.post_status = 'tribe-ea-draft' OR greaterpocono_posts.post_status = 'new' OR greaterpocono_posts.post_status = 'interviewed' OR greaterpocono_posts.post_status = 'offer' OR greaterpocono_posts.post_status = 'hired' OR greaterpocono_posts.post_status = 'archived' OR greaterpocono_posts.post_status = 'private') GROUP BY greaterpocono_posts.ID ORDER BY EventStartDate DESC, greaterpocono_posts.post_date DESC LIMIT 0, 1Please pay attention to these lines:
Problematic Line: MIN(greaterpocono_postmeta.meta_value) as EventStartDate, Source of Problem: LEFT JOIN greaterpocono_postmeta as tribe_event_end_date ON ( greaterpocono_posts.ID = tribe_event_end_date.post_idThe propper way in which this SQL query run should be this:
SELECT DISTINCT greaterpocono_posts.*, MIN(tribe_event_end_date.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM greaterpocono_posts LEFT JOIN greaterpocono_term_relationships ON (greaterpocono_posts.ID = greaterpocono_term_relationships.object_id) LEFT JOIN greaterpocono_postmeta as tribe_event_end_date ON ( greaterpocono_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) WHERE 1=1 AND (greaterpocono_term_relationships.term_taxonomy_id IN (25)) AND greaterpocono_posts.post_type = 'tribe_events' AND (greaterpocono_posts.post_status = 'publish' OR greaterpocono_posts.post_status = 'expired' OR greaterpocono_posts.post_status = 'tribe-ea-success' OR greaterpocono_posts.post_status = 'tribe-ea-failed' OR greaterpocono_posts.post_status = 'tribe-ea-schedule' OR greaterpocono_posts.post_status = 'tribe-ea-pending' OR greaterpocono_posts.post_status = 'tribe-ea-draft' OR greaterpocono_posts.post_status = 'new' OR greaterpocono_posts.post_status = 'interviewed' OR greaterpocono_posts.post_status = 'offer' OR greaterpocono_posts.post_status = 'hired' OR greaterpocono_posts.post_status = 'archived' OR greaterpocono_posts.post_status = 'private') GROUP BY greaterpocono_posts.ID ORDER BY EventStartDate DESC, greaterpocono_posts.post_date DESC LIMIT 0, 1Changing “greaterpocono_postmeta” by “tribe_event_end_date” where “greaterpocono_” is our WordPress Prefix set in configs (FYI)
As the previous plugin we wait an official update fixing this problem hence we can avoid as much as possible made custom fixes to overcome this error.
– – –
Thanks.
August 17, 2017 at 12:43 pm #1337028Konrad Nierwinski
ParticipantThis reply is private.
August 18, 2017 at 12:47 pm #1337540Cliff
MemberThis reply is private.
August 25, 2017 at 2:53 pm #1340541Konrad Nierwinski
ParticipantThis reply is private.
August 28, 2017 at 4:09 pm #1341467Cliff
MemberThank you for the details.
I experienced the console error you mentioned at your links, but we don’t have any admin-ajax.php bugs known to us and aren’t able to reproduce this issue.
Your initial post to this thread looked like it might have come from a reporting or monitoring software. Are you using something like this?
Do you have anything custom regarding access to the admin-ajax.php file? We’ve seen this be the issue a number of times due to misunderstanding of blocking this file in attempting to block anything with “wp-admin” in the URL.
===
tribe_singleton() is located in the “common” subfolder: /wp-content/plugins/the-events-calendar/common/
It’s a git submodule that gets packaged into both The Events Calendar and Event Tickets. There’s logic to load the latest version of common if one is more recent than the other.
Here’s tribe_singleton’s declaration in that GitHub repository: https://github.com/moderntribe/tribe-common/blob/4.5.10.1/src/Tribe/Container.php#L28
So this shouldn’t be causing an error if you’re on the latest versions of all our plugins.
September 19, 2017 at 9:39 am #1351275Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘SQL Error and AJAX errors in Events Calendar 4.5.10 / Addons’ is closed to new replies.
