Vai al contenuto Vai alla barra laterale

Etichettato: 

Questo ticket contiene 0 risposta, ha 0 voci.

Ultimo aggiornamento da michaelP-93 11 mese, 2 settimana fa.

Assistito da: Bruno Kos.

Autore Post
Aprile 25, 2025 alle 12:39 #16968542

michaelP-93

Background of the issue:
I am trying to view a post listing in the WordPress admin for a post type without any posts, specifically for Advanced Custom Fields field groups. The issue can be seen at /wp-admin/edit.php?post_type=acf-field-group.

This error was previously mentioned at https://wpml.org/forums/topic/fatal-error-an-error-of-type-e_error-was-caused-in-line-26-of-the-file-sitepress-multilingual-cms/.

Software versions:
- WPML: 4.7.3
- WordPress: 6.7.2
- PHP: 8.2

Symptoms:
I expected to see the (empty) listing of ACF field groups. Instead, I got a fatal error.

The WordPress admin displays a fatal error message: 'There has been a critical error on this website. Please check your site admin email inbox for instructions. If you continue to have problems, please try the support forums.'

The WordPress debug.log file contains the following error: [25-Apr-2025 12:22:15 UTC] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /app/wp-content/plugins/sitepress-multilingual-cms/menu/post-menus/wpml-posts-listing-page.class.php:26 Stack trace: #0 /app/wp-includes/class-wp-hook.php(324): WPML_Posts_Listing_Page->pre_populate_caches(Object(WP)) #1 /app/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #2 /app/wp-includes/plugin.php(565): WP_Hook->do_action(Array) #3 /app/wp-includes/class-wp.php(830): do_action_ref_array('wp', Array) #4 /app/wp-includes/functions.php(1336): WP->main(Array) #5 /app/wp-admin/includes/post.php(1306): wp(Array) #6 /app/wp-admin/includes/class-wp-posts-list-table.php(165): wp_edit_posts_query() #7 /app/wp-admin/edit.php(235): WP_Posts_List_Table->prepare_items() #8 {main} thrown in /app/wp-content/plugins/sitepress-multilingual-cms/menu/post-menus/wpml-posts-listing-page.class.php on line 26.

Questions:
How can I resolve the fatal error when viewing an empty post listing for ACF field groups?