Automattic / WP-Job-Manager

Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
https://wpjobmanager.com
GNU General Public License v3.0
895 stars 366 forks source link

Datetime error in 2.2.0 resolved by downgrading to 2.1.1 #2722

Closed bshuchter closed 6 months ago

bshuchter commented 6 months ago

Describe the bug

After the 2.2.0 upgrade, all job submissions don't complete, producing the following error:

Fatal error: Uncaught TypeError: Return value of WP_Job_Manager_Form_Submit_Job::maybe_format_future_datetime() must be an instance of mixed, bool returned in /home/customer/www/chrg.compensationhr.com/public_html/wp-content/plugins/wp-job-manager/includes/forms/class-wp-job-manager-form-submit-job.php:1098 Stack trace: #0 /home/customer/www/chrg.compensationhr.com/public_html/wp-content/plugins/wp-job-manager/includes/forms/class-wp-job-manager-form-submit-job.php(1142): WP_Job_Manager_Form_Submit_Job->maybe_format_future_datetime('') #1 /home/customer/www/chrg.compensationhr.com/public_html/wp-content/plugins/wp-job-manager/includes/abstracts/abstract-wp-job-manager-form.php(112): WP_Job_Manager_Form_Submit_Job->preview_handler() #2 /home/customer/www/chrg.compensationhr.com/public_html/wp-includes/class-wp-hook.php(324): WP_Job_Manager_Form->process(Object(WP)) #3 /home/customer/www/chrg.compensationhr.com/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #4 /home/customer/www/chrg.com in /home/customer/www/chrg.compensationhr.com/public_html/wp-content/plugins/wp-job-manager/includes/forms/class-wp-job-manager-form-submit-job.php on line 1098

I downgrade to version 2.1.1 and the form is able to submit job listings successfully.

I believe the error above has to do with the new scheduling function in 2.2.0, but you would know that better than I.

Other than this issue, thanks for a great plugin!

Hastibe commented 6 months ago

Also reported multiple times here: https://wordpress.org/support/topic/php-fatal-error-on-job-submission-version-2-2-0/

dericleeyy commented 6 months ago

Thanks, @bshuchter, for the report and details.

I've just done some testing, and the issue only seems to affect PHP 7.4 and below. It does not affect PHP 8.1.