Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing a fatal error when accessing the Pronamic plugin in the admin site, particularly when a custom post type has no posts, this might be due to a specific configuration issue.

Solution:
We have identified that the issue is not directly caused by WPML. However, setting

'hierarchical' => false

in the Pronamic Pay with Rabo Smart Pay for WooCommerce plugin's custom post type (CPT) registration can prevent this issue. This adjustment addresses the root of the problem by modifying how the CPT is handled.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Additionally, if you need further assistance, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 29 replies, has 5 voices.

Last updated by Diego Pereira 2 months, 1 week ago.

Assisted by: Waqas Bin Hasan.

Author Posts
August 8, 2024 at 7:26 am #16050888

robbertv-5

Background of the issue:
I am trying to: In admin site crashes when I go to a plugin "pronamic". Link to a page where the issue can be seen: hidden link

This problem is known but stil not fixed?
https://wpml.org/forums/topic/crash-when-a-custom-post-type-has-no-posts/

Symptoms:
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/post-menus/wpml-posts-listing-page.class.php:26 Stack trace: #0 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-includes/class-wp-hook.php(324): WPML_Posts_Listing_Page->pre_populate_caches() #1 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #2 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-includes/plugin.php(565): WP_Hook->do_action() #3 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-includes/class-wp.php(830): do_action_ref_array() #4 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-includes/functions.php(1336): WP->main() #5 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-admin/includes/post.php(1306): wp() #6 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-admin/includes/class-wp-posts-list-table.php(165): wp_edit_posts_query() #7 /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-admin/edit.php(235): WP_Posts_List_Table->prepare_items() #8 {main} thrown in /home/1311505.cloudwaysapps.com/vjpjkymsjk/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/post-menus/wpml-posts-listing-page.class.php on line 26. There has been a critical error on this website. Please check your site admin email inbox for instructions.

Questions:
How can I resolve the fatal error when accessing the Pronamic plugin in the admin site?
What steps should I take to prevent the site from crashing when a custom post type has no posts?

August 8, 2024 at 7:44 am #16050949

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

1) Can you please if the issue still happens when using WP default theme and only WPML plugins, Woocomerce and Pronamic are enabled?

2) I have tried to reproduce but it seems to work fine:

- hidden link

Can you please check if I am missing something and if you can reproduce the issue there?

3) Also please check if the workaround helps for your case, as it might be something specific to your website and not an WPML bug.

Let us know.

Thanks,
Drazen

August 8, 2024 at 7:55 am #16051022

robbertv-5

It's in combination with object cache pro plugin

August 8, 2024 at 7:57 am #16051023

robbertv-5

Image

Scherm­afbeelding 2024-08-08 om 09.56.31.png
August 8, 2024 at 8:42 am #16051266

robbertv-5

When i add if (empty($wp_query->posts)) return;

its working, but need a stable fix

August 8, 2024 at 12:22 pm #16052629

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

As mentioned by my colleague during the chat that this issue hasn't been raised with WPML since it is not due to WPML but from the incompatible plugins "Pronamic" and "Object Cache Pro".

Because we can not reproduce this issue with only WPML, as well as, with "Pronamic". So the provided workaround is a temporary one. While I recommend checking with the said plugin authors.

On the other hand, can you install Object Cache Pro at hidden link and reproduce the error?

I'll also request to try creating a custom post via another plugin and see if you can reproduce the same issue?

Please let me know and I'll try my best to help you further on the matter.

Regards.

August 8, 2024 at 12:36 pm #16052697

robbertv-5

Hi

i installed the plugin, but cant set config on my side to enable,

Scherm­afbeelding 2024-08-08 om 14.35.36.png
August 8, 2024 at 12:50 pm #16052801

robbertv-5

i also tested the reds plugin from the wordpress repository.
It gives the same WPML error.

August 8, 2024 at 12:52 pm #16052811

robbertv-5

this one https://wordpress.org/plugins/redis-cache/

August 9, 2024 at 6:13 am #16054908

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for trying and providing the feedback.

I'll check about it soon and 'll get back to you accordingly.

August 9, 2024 at 11:19 am #16056142

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. I was also not able to configure Object Cache Pro and Redis Object Cache plugins due to licenses.

However, I tried WC Total Cache which offers Object Caching also and then created a new gateway post in hidden link.

I tried this a few times by emptying these posts and every time it worked fine.

Can you please take a look at the said plugin's caching features (hidden link) and see if you can configure it like yours? And if the issue can be reproduced.

This way we can see if issue with Object Caching's particular config or specifically with Object Cache Pro and I'll be able to escalate the issue accordingly.

August 9, 2024 at 11:28 am #16056166

robbertv-5

Hi

Thank you for testing.

The WC total cache is not the same as Redis.
It needs a config to the server.
WC total cache does not have those settings.

FYI with cloudways its pre-installed Pro.
If you go for the Redis plugin they have an tutorial>
hidden link

Both require a connection/setting in the config.php to the redis service.

You can test the Redis plugin. It does not have a license.
But it need settings, can you create that?

You can also send me a personal email and I can create access to a test server.

August 12, 2024 at 4:53 am #16060475

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the test server, I was able to login and add a test configuration post in hidden link without any errors.

Is there any specific step which I may be missing, in order to reproduce the issue?

I see that Object Cache Pro is also active and configured.

August 12, 2024 at 5:58 am #16060491

robbertv-5

I see you missed to install WPML.
I did for you now and the error is there.

Scherm­afbeelding 2024-08-12 om 07.57.27.png
August 12, 2024 at 1:04 pm #16062365

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Oh ok, thank you for clarifying, I should've checked.

I am working on it and 'll get back to you accordingly.