Describe the bug
I have a ajax 500 fatal error as shown here:
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /domain-pathxxxx/wp-content/plugins/wp-job-manager-alerts/includes/class-add-alert.php:57
To Reproduce
Steps to reproduce the behavior:
Go to '/jobs-listing/' with activated job alert plugin "Job Alerts 3.0.0"
the job list don't load and a 500er error is shown in the webbrowser console
Solution
I changed the code in class-add-alert.php:57 ff
Describe the bug I have a ajax 500 fatal error as shown here: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /domain-pathxxxx/wp-content/plugins/wp-job-manager-alerts/includes/class-add-alert.php:57
To Reproduce Steps to reproduce the behavior:
Solution I changed the code in class-add-alert.php:57 ff
from if ( count( $args['filter_job_types'] ) !== count( $all_job_types ) ) { foreach ( $args['filter_job_types'] as $job_type ) { $job_type_term = get_term_by( 'slug', $job_type, 'job_listing_type' ); $job_type_array[] = $job_type_term->term_id; } }
to if (is_countable($args['filter_job_types']) && count($args['filter_job_types']) > 0) { if ( count( $args['filter_job_types'] ) !== count( $all_job_types ) ) { foreach ( $args['filter_job_types'] as $job_type ) { $job_type_term = get_term_by( 'slug', $job_type, 'job_listing_type' ); $job_type_array[] = $job_type_term->term_id; } } }
Expected behavior After adding the code from the solution it works, the job list is loading again
Isolating the problem (mark completed items with an [x]):
WordPress Environment