Looking at the plugin code, it appears to be doing various calculations and checks using a piece of postmeta with the key _EventDuration which I don’t have in my database.
Specifically, it looks like this piece of SQL may be the culprit:
IFNULL(DATE_ADD(CAST(eventStart.meta_value AS DATETIME), INTERVAL eventDuration.meta_value SECOND), eventEnd.meta_value) as EventEndDate
Replacing it with the following means I get the correct end date through, but I expect this will break things in other circumstances:
eventEnd.meta_value as EventEndDate
It looks like MySQL is treating the null value of eventDuration.meta_value as 0 for the purposes of the DATE_ADD() call. Perhaps this is specific to certain versions of MySQL and is why not everyone is getting the problem? I’m on MySQL 5.6.10.
Hi hintack315 pr cebronix,
Would you be willing to provide us with a db dump so we can test out what you’re working with? You can email to pro [at] tri [dot] be – please attn. to me and reference this thread so we know what it’s for.
Thanks,
Jonah
This problem is definitely due to a change in MySQL 5.6 for us. It may well be a MySQL 5.6 bug, I’ll be reporting it to them too.
Assuming there is no post ID 99999, running the following query shows different results in <5.6 and 5.6…
SELECT IFNULL(DATE_ADD(CAST(NOW() AS DATETIME), INTERVAL a.meta_value SECOND), 'duration is null') AS duration, a.meta_value
FROM wp_postmeta m
LEFT JOIN wp_postmeta a ON a.post_id = 99999
LIMIT 0,1
MySQL 5.5 result (which is expected by the Events Calendar code):
duration: “duration is null”
meta_value: NULL
MySQL 5.6 result:
duration: “2013-04-03 17:27:49.000000”
meta_value: NULL
Interestingly, if we just do the following query the results differ:
SELECT IFNULL(DATE_ADD(CAST(NOW() AS DATETIME), INTERVAL null SECOND), 'duration is null') AS duration
MySQL 5.5 result:
duration: “duration is null”
MySQL 5.6 result:
duration: “duration is null”
Thanks for sharing that jaikdean!
My bug report on MySQL has now been verified.
Hey guys, since I haven’t heard back from anyone on getting a DB dump for this, I’m going to have to close the ticket out. If anyone wants to provide a DB dump, please let me know in the next few days.
Thanks,
Jonah
Closing this out since I haven’t heard back from anyone on this. Feel to re-open if need be.
Cheers,
Jonah
Hello Jonah,
I’m having the same problem as hintack315 but I really cannot find a way to fix this…
Has anyone find a solution for this bug?
Cheers
Hi heartbox,
In order to look into this any further we need a DB dump to be able to test things out on our end. Can you provide us with that?
Hi all, can anyone having this problem please confirm what version of the plugin you are running? Ideally you should be on 2.0.11
Thanks,
Jonah
Sorry, I’ve moved to a different plugin. But yes, it was 2.0.11
Thanks cebronix, anyone else still having this issue, can you tell me what version of the plugin you are running?
– Jonah
Hi Jonah,
Sure I can send you a DB dump, I still have the problem.
Please let me know where I have to send it to you
Thanks a lot
ps. running v 2.0.11
Hi heartbox,
Please send it to pro [at] tri [dot] be and attn. to me and reference this thread so I know what it’s about.
Thanks,
Jonah
Hey heartbox,
I never got an email from you on this and we need to either get going on this or close out the ticket. Are you still planning on sharing a db dump? If I don’t hear from you in the next few days I’m going to close this out.
Thanks,
Jonah