Support

Home Forums Recurring Events Manager Add-on WordPress Database Error

WordPress Database Error

Posted: November 9, 2023 at 5:42 pm


arc@surgeons.org

November 9, 2023 at 5:42 pm

Hi There
I am posting this message a second time because my browser packed up on form submission and I am not sure if this issue got posted. Sorry for the repetition if this is a duplicate. I am getting a WordPress Database error when I try to update a recurring series of events. The updates seem to be successful. I am running EE3 under PHP8. The error message is:

[Incorrect DATE value: ”]
SELECT recurrence_id FROM wp_n20m1z0mh3_events_recurrence WHERE recurrence_id = 921 AND recurrence_start_date = ‘0000-00-00’ AND recurrence_event_end_date = ” AND recurrence_end_date = ‘0000-00-00’ AND recurrence_frequency = ‘d’ AND recurrence_interval = 1 AND recurrence_type = ‘m’ AND recurrence_weekday = ‘a:0:{}’ AND recurrence_repeat_by = ‘dom’ AND recurrence_regis_date_increment = ‘N’ AND recurrence_manual_dates = ‘a:4:{i:0;s:10:\”2024-03-11\”;i:1;s:10:\”2024-06-10\”;i:2;s:10:\”2024-09-06\”;i:3;s:0:\”\”;}a:4:{i:0;s:10:\”2024-03-11\”;i:1;s:10:\”2024-06-10\”;i:2;s:10:\”2024-09-06\”;i:3;s:0:\”\”;}’ AND recurrence_regis_start_date = ‘2022-03-11’ AND recurrence_regis_end_date = ‘2024-03-11’

Thank you for looking into this.
Regards,
Mark


Tony

  • Support Staff

November 10, 2023 at 2:29 am

Hi Mark,

The dates being ‘0000-00-00’ would be invalid, I assume you are setting a date?

Can you post a screenshot of the REM settings you are using to update?


arc@surgeons.org

November 10, 2023 at 4:19 am

Hi Tony,
Thanks for your reply. I am not setting a date. I get this error when I update any value in a series of recurring events. Say for example I wanted to change an event title and select the All events in the series radio button, when I click on update I get the database error. All the dates are actually valid and I do not change any of them. There are no blank date values in the series of dates either. Here is screenshot
REM Values
Thanks and regards,
Mark


arc@surgeons.org

November 10, 2023 at 4:21 am

REM Values


arc@surgeons.org

November 10, 2023 at 4:23 am

Above is a link to the screenshot.


Tony

  • Support Staff

November 10, 2023 at 6:48 am

Ok, I did some digging into this, it looks like a change in PHP8 is affecting the recurring events manager here.

If you are comfortable with PHP/FTP the fix is to go to:

\event-espresso\includes\event-management\update_event.php

Line 43-44 should be something like:

'start_date'					=> !empty($_POST['recurrence_start_date']) ? sanitize_text_field($_POST['recurrence_start_date']) : '',
'event_end_date'				=> !empty($_POST['recurrence_event_end_date']) ? sanitize_text_field($_POST['recurrence_event_end_date']) : '',

Change that to be:

'start_date'					=> !empty($_POST['recurrence_start_date']) ? sanitize_text_field($_POST['recurrence_start_date']) : '0000-00-00',
'event_end_date'				=> !empty($_POST['recurrence_event_end_date']) ? sanitize_text_field($_POST['recurrence_event_end_date']) : '0000-00-00',

That will allow you to update the event/series.

Something to note here, we have deprecated EE3 in favour EE4 as it now supports recurring events. We announced a while back that EE3 would be grandfathered and only receive security updates which the above is not so I’m not sure if we’ll push an update to fix this but I’ve posted the above so you’re not stuck without a solution.

Whilst I’m not saying you need to switch to EE4 now! Is/has something been preventing you from switching over to EE4?


arc@surgeons.org

November 10, 2023 at 8:15 pm

Hi Tony,
Thank you so much for posting that solution – it worked perfectly!!
Re EE3 – I suppose I have been operating under the premise that if it ain’t broke… but now I am feeling more motivated to do something about updating. I think last time I posted you told me that there is a clear path for migrating from EE3 to EE4. Perhaps over the christmas / new year period when my site is less busy might be a good time to make the jump. I admit to being a little bit hesitant, perhaps if I could try the update on my staging site first it would give me more confidence to update the production site. Thank you again for your expert help. It is very much appreciated. I will probably reach out again when the time comes to update.
Regards,
Mark


Tony

  • Support Staff

November 12, 2023 at 6:30 am

Thank you so much for posting that solution – it worked perfectly!!

Awesome! I’m glad it worked for you 🙂

I suppose I have been operating under the premise that if it ain’t broke…

🙂 I see this a lot, however as you update PHP more and more (which you should be doing as you already are) you’ll run into more and more issues with EE3, so it will end up broken and that’s when its a panic to fix or your host complaining they need to support and older version of PHP (some are doing so and charging a premium for supporting older PHP versions).

I think last time I posted you told me that there is a clear path for migrating from EE3 to EE4.

Correct, EE4 has migration scripts that will pull in the EE3 data over to EE4 when you first activate it (note is happens on initial activation so you can’t swap and change between the 2 versions over and over).

Perhaps over the christmas / new year period when my site is less busy might be a good time to make the jump. I admit to being a little bit hesitant, perhaps if I could try the update on my staging site first it would give me more confidence to update the production site.

EE4 is not ‘just and update’ for EE3… it’s a completely different system built from the ground up. The database schema is totally different and things work very differently internally (EE4 relies much more on your theme than EE3 did for multiple different reasons).

So knowing that I always recommend updating on a staging site first to confirm registrations work as you expect. I’m not saying check every single feature on your staging site… but migrate, pick an event, register onto it and confirm things work as you require for a normal customer, niggly issues can be worked on from there but you’ll know if anything major will come up.

Being hesitant is perfectly understandable and I don’t hide the fact that EE4 is very different for that exact reason. Generally things ‘just work’ and you don’t run into anything major, it works, differently to how your used to EE3, but it works 🙂

If you need help on the best way to do that just post up and I’ll walk through some options with you.

Thank you again for your expert help. It is very much appreciated. I will probably reach out again when the time comes to update.

You’re most welcome and please do, I’m always happy to help.


arc@surgeons.org

November 12, 2023 at 6:44 pm

Hi Tony,
Thank you so much for all your great help. It really is very much appreciated.
I will be in-touch again in the not too distant future re migrating over to EE4.
Best regards,
Mark

The support post ‘WordPress Database Error’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso