Blank Calendar Shows: Malformed SQL Query when using sub-set of subscribed Cals
-
We have multiple subscriptions to Google Subject Calendars for students.
Every once in a while, when accessing the site/calendar page, *no* events show on the month view.
I enabled debug and observed this SQL error:
-
SELECT 'p'.*, 'e'.'post_id', 'i'.'id' AS 'instance_id', 'i'.'start' AS 'start', 'i'.'end' AS 'end', 'e'.'timezone_name' AS 'timezone_name', 'e'.'allday' AS 'event_allday', 'e'.'recurrence_rules', 'e'.'exception_rules', 'e'.'recurrence_dates', 'e'.'exception_dates', 'e'.'venue', 'e'.'country', 'e'.'address', 'e'.'city', 'e'.'province', 'e'.'postal_code', 'e'.'instant_event', 'e'.'show_map', 'e'.'contact_name', 'e'.'contact_phone', 'e'.'contact_email', 'e'.'contact_url', 'e'.'cost', 'e'.'ticket_url', 'e'.'ical_feed_url', 'e'.'ical_source_url', 'e'.'ical_organizer', 'e'.'ical_contact', 'e'.'ical_uid', 'e'.'longitude', 'e'.'latitude' FROM wp_ai1ec_events e INNER JOIN wp_posts p ON ( 'p'.'ID' = 'e'.'post_id' ) INNER JOIN wp_ai1ec_event_instances i ON ( 'e'.'post_id' = 'i'.'post_id' ) LEFT JOIN 'wp_term_relationships' AS 'term_relationships_events_categories' ON ( 'e' . 'post_id' = 'term_relationships_events_categories' . 'object_id' ) LEFT JOIN 'wp_term_taxonomy' AS 'term_taxonomy_events_categories' ON ('term_relationships_events_categories' . 'term_taxonomy_id' = 'term_taxonomy_events_categories' . 'term_taxonomy_id' AND 'term_taxonomy_events_categories' . taxonomy = 'events_categories' ) WHERE post_type = 'ai1ec_event' AND i.end > 1443682800 AND i.start < 1446361200 ( term_taxonomy_events_categories.term_id IN ( 28,11,4,12,22,23,17,24,13,25,8,14 ) ) AND post_status IN ( 'publish', 'private' ) GROUP BY 'i'.'id' ORDER BY 'e' . 'allday' DESC, 'i' . 'start' ASC, 'p' . 'post_title' ASC
Note that an “AND” is missing between “AND i.start” and “AND post_status” for the “term_taxonomy_events_categories.term_id IN” clause.
Steps to replicate:
1. Create 15 unique calendar feeds
2. Customize default view to show 12 out of 15 feeds, default month view
3. Go to https://fqdn.domain.tld/calendarExpected:
Events show for current month when accessing https://site/calendar
Actual:
No events show in month view ( they do in the event widget for the current day ).
Code fix:
~/app/model/search.php line 176
The call to ‘ . $filter[‘filter_where’] . ‘ doesn’t seem to be returning a leading “AND” for the SQL query.
Platform Info:
Debian: 8.2
Wordpress: 4.3.1
MariaDB: 10.0.20-0+deb8u1
libapache2-mod-php5: 5.6.13+dfsg-0+deb8u1
apache2: 2.4.10-10+deb8u3 -
- The topic ‘Blank Calendar Shows: Malformed SQL Query when using sub-set of subscribed Cals’ is closed to new replies.