Hello,
we have a difficulty with the function echo eo_get_the_start ().
On the archive page (archive-event.php) in a child theme the date is displayed perfectly, while on taxonomy-event-venue.php, it does not appear (Ditto for category).
Using parent files (original) or child.
In eo-loop-single-event.php we put the eo_get_the_start function (); because eo_format_event_occurrence (); presents the same problem and more about the taxonomy lists it triggers a previously reported error here.(http://wp-event-organiser.com/forums/topic/bad-message/ or http://wp-event-organiser.com/forums/topic/error-on-page-single-event-php/ )
We have not identified.
The single-event page shows no error.
WP 4.6.1 environment, multisite, with Polylang
Best regards
Pierre Gauer
If you’re getting the error described in that post, it’s because it’s trying to get the start date of an event which doesn’t appear to have a date stored against it (or doesn’t exist).
It might be worth dumping get_the_ID()
and looking up the ID, and seeing if it corresponds to an event, and if so checking the eo_events.event_id
column for that value.
My suspicion is that Polylang is duplicating the events, but the link to the dates is not also duplicated. So that page is rending a list of translated events which don’t have any dates stored against them.
Stephen Harris
Thank you, I explored the duplication of events. The error is not on a detail page, but on the pages of taxonomy.
And it does not explain why the date does not appear on the lists of taxonomy, as it is published on the detail pages and archives.
Pierre Gauer
Yes you’re right, I think that rules out Polyang.
Have you added any other post types to the category/venue taxonomies? My other recommendation would be to install QueryMonitor and inspect the main query on the taxonomy page (it will list all queries for the at page load, so you’ll need to scan through and identify the one that looks like it is the ‘main query’ – it should in this case involve eo_events
table.).
If you could post that query here that may help identify the problem.
Stephen Harris
Sorry but I could not deal with it earlier.
Test on this page :
http://www.notredamedevie.org/agenda/public/tout-public
For each event :
<hr />
248 SELECT event_id, StartDate,StartTime,EndDate,FinishTime
FROM 6NhK_2_eo_events
WHERE 6NhK_2_eo_events.post_id=4341
AND 6NhK_2_eo_events.event_id=0
ORDER BY StartDate ASC<br />
eo_get_the_occurrence()
wp-content/plugins/event-organiser/includes/event-organiser-event-functions.php:282
252 SELECT event_id, StartDate,StartTime,EndDate,FinishTime
FROM 6NhK_2_eo_events
WHERE 6NhK_2_eo_events.post_id=4338
AND 6NhK_2_eo_events.event_id=0
ORDER BY StartDate ASC<br />
eo_get_the_occurrence()
wp-content/plugins/event-organiser/includes/event-organiser-event-functions.php:282
254 SELECT event_id, StartDate,StartTime,EndDate,FinishTime
FROM 6NhK_2_eo_events
WHERE 6NhK_2_eo_events.post_id=4337
AND 6NhK_2_eo_events.event_id=0
ORDER BY StartDate ASC<br />
eo_get_the_occurrence()
wp-content/plugins/event-organiser/includes/event-organiser-event-functions.php:282
……
<hr />
274 SELECT 6NhK_2_posts.*, 6NhK_2_eo_events.event_id, 6NhK_2_eo_events.event_id AS occurrence_id, 6NhK_2_eo_events.StartDate, 6NhK_2_eo_events.StartTime, 6NhK_2_eo_events.EndDate, 6NhK_2_eo_events.FinishTime, 6NhK_2_eo_events.event_occurrence
FROM 6NhK_2_posts
LEFT JOIN 6NhK_2_term_relationships
ON (6NhK_2_posts.ID = 6NhK_2_term_relationships.object_id)
LEFT JOIN 6NhK_2_eo_events
ON 6NhK_2_posts.ID = 6NhK_2_eo_events.post_id
WHERE 1=1
AND ( 6NhK_2_term_relationships.term_taxonomy_id IN (79) )
AND 6NhK_2_posts.post_type = ‘event’
AND (6NhK_2_posts.post_status = ‘publish’
OR 6NhK_2_posts.post_status = ‘confirmed’
OR 6NhK_2_posts.post_status = ‘private’)
AND (6NhK_2_eo_events.StartDate > ‘2016-10-04’
OR (6NhK_2_eo_events.StartDate = ‘2016-10-04′
AND 6NhK_2_eo_events.StartTime > ’18:24:23’))
GROUP BY 6NhK_2_eo_events.event_id
ORDER BY 6NhK_2_eo_events.StartDate ASC, 6NhK_2_eo_events.StartTime ASC
LIMIT 0, 3
Best regards
Pierre Gauer
The last query looks fine. The other three have the event_id set to 0, which shouldn’t be the case.
Either the function is being called with the occurrence ID set to 0, or it’s not available in the global post (which would be odd, considering it seems the main query is correctly pulling this ID out of the database).
I’ve just sent you an e-mail about investigating this further.
Stephen Harris