I am trying to:
Link to a page where the issue can be seen:
I expected to see:
Instead, I got:
Error Details ============= An error of type E_ERROR was caused in line 402 of the file /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php. Error message: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1918554-09-07 01:00:58) at position 14 (0): Double time specification in /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php:402 Stack trace: #0 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php(402): DateTime->__construct('1918554-09-07 0…') #1 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php(264): OTGS\Toolset\CRED\Controller\ExpirationManager\Post\Singular->get_raw_date_by_time('60481570842058') #2 /wordpress/core/5.2.4/wp-includes/class-wp-hook.php(288): OTGS\Toolset\CRED\Controller\ExpirationManager\Post\Singular->maybe_save_expiration_date(23155)
Hi David,
Thank you for contacting us and I'd be happy to assist.
Are you seeing this error on the screen or in the server's error log? And does it appear for all posts or a specific one?
I'll recommend making sure that WordPress, active theme and all plugins are updated to their latest versions and then check for the error, with only Toolset plugins enabled. You can temporarily disable all other plugins and switch to a default theme like Twenty Nineteen, after making a complete backup copy of the website.
If the issue is fixed, you can start adding the disabled items, one-by-one, to narrow down to possible conflict.
In case the issue still persists, you're welcome to share temporary admin login details, along with the information about the post or screen, where this error can be seen.
Let me know how it goes and your next reply will be private.
regards,
Waqar
Hi David,
Thank you for sharing the admin access.
I performed some tests on my own website, with a similar post edit form, but couldn't reproduce this error. To investigate why this is appearing on your website, I'll need its clone/snapshot.
Here is a guide on sharing the website's clone/snapshot and your next reply will be private:
https://toolset.com/faq/provide-supporters-copy-site/
regards,
Waqar
Hi David,
Thank you for sharing the link to the website's clone, but I'll need it as a downloadable copy so that it can be installed on a personal server.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )
Do I have your permission to install the "Duplicator" plugin ( hidden link ) on this clone and download the package directly?
regards,
Waqar
yes, you have permission.
message today
Error Details ============= An error of type E_ERROR was caused in line 402 of the file /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php. Error message: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1918554-10-03 18:32:44) at position 14 (1): Double time specification in /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php:402 Stack trace: #0 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php(402): DateTime->__construct('1918554-10-03 1…') #1 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php(264): OTGS\Toolset\CRED\Controller\ExpirationManager\Post\Singular->get_raw_date_by_time('60481573151564') #2 /wordpress/core/5.3/wp-includes/class-wp-hook.php(290): OTGS\Toolset\CRED\Controller\ExpirationManager\Post\Singular->maybe_save_expiration_date(23155) #3 /wordpress/core/5.3/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #4 /wordpress/core/5.3/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #5 /wordpress/core/5.3/wp-includes/post.php(4119): do_action('save_post', 23155, Object(WP_Post), true) #6 /wordpress/core/5.3/wp-includes/post.php(4196): wp_insert_post(Array, false) #7 /wordpress/core/5.3/wp-admin/includes/post.php(407): wp_update_post(Array) #8 /wordpress/core/5.3/wp-admin/post.php(219): edit_post() #9 {main}
Hi David,
I wasn't able to create and download the clone of your website, due to file permissions, but I was able to reproduce this error on my test website.
This error only shows when a very far future date like "99999999 weeks" is set as the expiration date in the form's expiration settings.
Can you please share more information about why your forms for Vendor directory listings are using such post-expiration dates?
regards,
Waqar
Thanks, ok that sounds like progress.
I do not know why the future dates are set to so high. Where can I can change those?
Hi David,
You'll find the post-expiration settings on the form edit screen.
Screenshot: hidden link
These expiration dates are set in the forms "Edit A Listing" and "Submit A Listing". If such far off dates are set for the post-expiration, then probably automatic post expiration feature doesn't need to be enabled in the first place.
( ref: https://toolset.com/documentation/user-guides/automatic-post-expiration/ )
I appreciate you brought this forward and I've shared the findings around this error message with the concerned team.
I'll keep you updated on the progress through this ticket.
regards,
Waqar
it looks like the "Draft" status is only available when the set expiration is selected. Perhaps this why we turned it on. Will the post be automatically published if I disable the post expiration date.
"After expiration change the status of the post to 'Draft'"
You should be able to set the post's status to "Draft" without setting any post-expiration date.
Example screenshot: hidden link
Also if the required workflow requires setting up a distant future post-expiration date, using a much lower value like "10000 weeks" should also work.
Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, Toolset Forms.
First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.
Please contact your host for assistance with investigating this issue further.
If your site appears broken and you can't access your dashboard normally, WordPress now has a special “recovery mode”. This lets you safely login to your dashboard and investigate further.
hidden link
To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
When seeking help with this issue, you may be asked for some of the following information: WordPress version 5.3 Current theme: Divi Child (version 1.0.0) Current plugin: Toolset Forms (version 2.5.3) PHP version 7.2.25
Error Details ============= An error of type E_ERROR was caused in line 402 of the file /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php. Error message: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1918554-10-07 16:01:18) at position 14 (1): Double time specification in /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php:402 Stack trace: #0 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php(402): DateTime->__construct('1918554-10-07 1…') #1 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/expiration_manager/post/singular.php(264): OTGS\Toolset\CRED\Controller\ExpirationManager\Post\Singular->get_raw_date_by_time('60481573488078') #2 /wordpress/core/5.3/wp-includes/class-wp-hook.php(290): OTGS\Toolset\CRED\Controller\ExpirationManager\Post\Singular->maybe_save_expiration_date(23155) #3 /wordpress/core/5.3/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #4 /wordpress/core/5.3/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #5 /wordpress/core/5.3/wp-includes/post.php(4119): do_action('save_post', 23155, Object(WP_Post), true) #6 /wordpress/core/5.3/wp-includes/post.php(4196): wp_insert_post(Array, false) #7 /wordpress/core/5.3/wp-admin/includes/post.php(407): wp_update_post(Array) #8 /wordpress/core/5.3/wp-admin/post.php(219): edit_post() #9 {main}
thrown
How do I know which form is causing the issue?
Can you please follow these steps:
1. Please check the edit screen of all your Toolset Forms and make sure that none of them has an unrealistic far future date set in the post-expiration settings.
2. If you see the on-screen error or the email related to the error next time, check the last edited post and make sure that its post-expiration date is not set to "1 January 1970".
As a general rule, if you see this date set as post-expiration in any post while editing it, it would be a good idea to disable the post-expiration option and you'll not see the error.
My issue is resolved now. Thank you!
Hi David,
I'd like to update that improvement regarding this far-future post expiration date is covered in the next Toolset Forms release ( 2.5.4 ).
As a result, it will only allow setting the post expiration date within the range that the PHP language can recognize and process.
Thank you for bringing this forward.
regards,
Waqar