Forum Replies Created
-
AuthorPosts
-
Andrew McChesney
ParticipantThank you for your reply. I understand MSSQL is not entirely supported or widely used for WordPress, but I’m required to use it given my company’s IT infrastructure requirements.
It appears that the SQL error displayed on all pages of the WordPress admin is generated by the “tribe_notice” function called in line 687 of src/Tribe/Main.php. If I comment out lines 687-689 (in The Events Calendar v4.6.1) those errors go away. I believe that normally those lines cause the display of an admin notice about slug conflicts. There are comments in the code about “@todo remove this safety check when we’re confident the risk has diminished”. Perhaps the risk has diminished enough at this point to remove these lines from the next release?
The 2nd SQL error that appears in the admin when viewing the “All Events” screen is:
SELECT DISTINCT wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) LEFT JOIN wp_postmeta AS tribe_event_start_date ON wp_posts.ID = tribe_event_start_date.post_id AND tribe_event_start_date.meta_key = '_EventStartDate' WHERE 1=1 AND wp_posts.post_type = 'tribe_events' AND ((wp_posts.post_status = 'tribe-ignored')) ORDER BY tribe_event_start_date.meta_value DESC, tribe_event_end_date.meta_value DESC, wp_posts.post_date DESC OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLYThe error is due to:
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]ORDER BY items must appear in the select list if SELECT DISTINCT is specified. Code - 145.I would rewrite the query, except I can’t figure out where it’s being generated from. The WP debug bar provides this info below the query:
WP_List_Table->views, apply_filters('views_edit-tribe_events'), WP_Hook->apply_filters, Tribe__Events__Ignored_Events->filter_views, Tribe__Events__Ignored_Events->has_ignored_posts, Tribe__Events__Ignored_Events->get_query, WP_Query->__construct, WP_Query->query, WP_Query->get_postsDisabling the “views_edit-tribe_events” filter doesn’t solve the problem.
I added a Project Nami Support suggestion to the UserVoice page… hopefully other users who are required to use MSSQL will vote it up, and Nami compatibility will be added to your test suite.
Thanks for making a great events calendar plugin.
-
This reply was modified 8 years, 7 months ago by
Andrew McChesney.
-
This reply was modified 8 years, 7 months ago by
-
AuthorPosts
