WP - Problem with appointment dates from 1970 to 3599?

Tiritiri

Member
May 5, 2022
71
24
8
World
Hello,

WP, last update
PHP 7.4

With a virtual product on sale on woocommerce the customer buys and that creates an appointment in the schedule without date.
Then he comes to change his date in his account...

Until now, the random date of wp was the basic one of sql, that is 1970-01-01
As well for the start date as for the end date.

But now it writes 3599-(current month)-(current day) as end date

It came after the WP update and the switch to php7.4
The theme, in spite of its overrides, has nothing to do with it because I tested with a basic theme and it's the same.

Someone already had this problem or would know the solution to reset the end date to 1970?

Thanks ;-)
 
  • Like
Reactions: Alkoz

Tiritiri

Member
May 5, 2022
71
24
8
World
Thanks a lot for your answer and help...
I really appreciate it because I have been having this problem for 2 weeks...

I already read the doc, but I can't understand the instruction I have to formulate and where to put it to force wordpress not to put start date in 1970 and end date in 3599 on an appointment without date (via a plugin that allows me to do it) But that wordpress put start date 1970 and end date 1970 so that I don't end up with the calendar filled with this appointment...

It's a mess :)
 
  • Like
Reactions: Alkoz

rackyman

New member
Sep 17, 2022
2
4
3
I am not fully able to understand your situation, sorry.
My guess is this is done by the plugin. One solution would be to set the plugin to save all appointments at a fixed time period. (instead of saving without date)


If that doesn't help let me know the full flow in details along with the plugin names, so that I can look it up
 
  • Like
Reactions: Alkoz and Tiritiri

Tiritiri

Member
May 5, 2022
71
24
8
World
I am not fully able to understand your situation, sorry.
My guess is this is done by the plugin. One solution would be to set the plugin to save all appointments at a fixed time period. (instead of saving without date)


If that doesn't help let me know the full flow in details along with the plugin names, so that I can look it up
Hello, thank you very much I send you in message the information and plugin. Originally this appointment without date was automatically registered on the date of 1970-01-01 (the sql date) which was fine but after the updates of wp, WooCommerce and the version of php the start date remained 1970-01-01 but the end date became 3599... Unbelievable
 
  • Like
Reactions: Alkoz

Tiritiri

Member
May 5, 2022
71
24
8
World

So sure it's in the overloads that there is something incompatible with: 1 - wordpress version or 2 - php version, 3 - something in the database (but I can't find 3599?).

Not to mention that this plugin should be updated, it's from 2016... anyway it's not that. Because it still works, except for this date of 3599

By scanning the code with PHP Compatibility Checker I find alerts on these overloads.
It is compatible with the version of php but...
There must be a line that gives the wrong direction...
But I'm not php. and my head explodes. I'm going to have a coffee :)


FILE: wp-content/plugins/woocommerce-appointments-surcharge/includes/integrations/woocommerce-product-addons/classes/class-product-addon-cart.php

FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------
340 | WARNING | Targeting a 'switch' control structure with a 'continue' statement is strongly discouraged and will throw a warning as of PHP 7.3.
357 | WARNING | Targeting a 'switch' control structure with a 'continue' statement is strongly discouraged and will throw a warning as of PHP 7.3.
390 | WARNING | Targeting a 'switch' control structure with a 'continue' statement is strongly discouraged and will throw a warning as of PHP 7.3.
409 | WARNING | Targeting a 'switch' control structure with a 'continue' statement is strongly discouraged and will throw a warning as of PHP 7.3.
———————————————————————————————————————————————————————

my problem is progressing, but in php I'm having trouble...
the debugger on the plugin tells me that..:


Deprecated: The get_product function is deprecated since version 3.0! Use wc_get_product instead. in /home/sc1vabw9579/development.sc1vabw9579.universe.wf/wp-includes/functions.php on line 5379

Notice: The function wc_appointment_max_date has been called incorrectly. Product properties should not be accessible directly. Backtrace: require('wp-admin/edit-form-advanced.php'), do_meta_boxes, WC_Appointments_Admin_Details_Meta_Box->meta_box_inner, WC_Product_Appointment->get_max_date, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please read Debugging in WordPress for more information. (This message was added in version 3.0.) in /home/sc1vabw9579/development.sc1vabw9579.universe.wf/wp-includes/functions.php on line 5831

Notice: The function wc_appointment_max_date has been called incorrectly. Product properties should not be accessible directly. Backtrace: require('wp-admin/edit-form-advanced.php'), do_meta_boxes, WC_Appointments_Admin_Details_Meta_Box->meta_box_inner, WC_Product_Appointment->get_max_date, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please read Debugging in WordPress for more information. (This message was added in version 3.0.) in /home/sc1vabw9579/development.sc1vabw9579.universe.wf/wp-includes/functions.php on line 5831

Notice: The function wc_appointment_max_date_unit has been called incorrectly. The product properties should not be accessible directly. Backtrace: require('wp-admin/edit-form-advanced.php'), do_meta_boxes, WC_Appointments_Admin_Details_Meta_Box->meta_box_inner, WC_Product_Appointment->get_max_date, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please read Debugging in WordPress for more information. (This message was added in version 3.0.) in /home/sc1vabw9579/development.sc1vabw9579.universe.wf/wp-includes/functions.php on line 5831

Notice: The function wc_appointment_max_date_unit has been called incorrectly. The product properties should not be accessible directly. Backtrace: require('wp-admin/edit-form-advanced.php'), do_meta_boxes, WC_Appointments_Admin_Details_Meta_Box->meta_box_inner, WC_Product_Appointment->get_max_date, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please read Debugging in WordPress for more information. (This message was added in version 3.0.) in /home/sc1vabw9579/development.sc1vabw9579.universe.wf/wp-includes/functions.php on line 5831

Deprecated: The get_product function is deprecated since version 3.0! Use wc_get_product instead. in /home/sc1vabw9579/development.sc1vabw9579.universe.wf/wp-includes/functions.php on line 5379 Translated with www.DeepL.com/Translator (free version)
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu