Skip Navigation

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

Problem:
You are setting up WPML for the first time and have enabled translation for custom post types created with the ACPT plugin. However, when these are enabled, the Translation Management page crashes
Solution:
First, ensure that the custom post types are compatible with WPML. Although not officially tested by our team, the ACPT plugin, has developed an integration with WPML. You can find more details here: https://docs.acpt.io/integrations/wpml

But you need to make sure that the 'hierarchical' parameter for your custom post types is explicitly set to either true or false during registration. If this parameter is omitted, it may default to null, causing the error.

If these steps do not resolve your issues or the solution seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If problems persist, we recommend opening a new support ticket at our 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.

Tagged: 

This topic contains 6 replies, has 0 voices.

Last updated by Otto 3 days, 22 hours ago.

Assisted by: Otto.

Author Posts
April 2, 2025 at 12:04 pm #16886878

romanT-13

Background of the issue:
I am trying to set up WPML on my site for the first time. I enabled translation for custom post types 'News' and 'governance'.

Symptoms:
When I enable custom post types to be translated, the Translation Management page crashes. The site itself does not crash, but I get an incorrect word count for the entire site. Most of the content is in Bricks editor, which is supposed to be fully compatible.

Questions:
Is there something that needs to be enabled or setup on my side?

April 2, 2025 at 1:19 pm #16887286

Otto
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

The custom post types are created with the ACPT plugin, right? They developed an integration with WPML:
hidden link

It's not on our compatibility list, though. This doesn't necessarily imply that it is not compatible, just that our team has not tested it yet.

Please follow the instructions mentioned on this page: https://wpml.org/documentation/support/debugging-wpml/
Then, try to reproduce the issue and check your installation's **wp-content** folder to see if a file named **"debug.log"** was created (it will only be generated if a server error occurs).
If the file was created, please upload it to a platform like **Google Drive** or **Dropbox** (whichever you usually use) and share the link with me (make sure it is publicly accessible) so I can analyze it.

About the word count when you open the editor do you see any content that shouldn't be there? Like JSON, CSS or HTML tags?

Try the following:
- Make a small edit in the original page and update
- Go again to WPML -> Translation Management and check if the word count was updated properly

Best Regards,
Otto

April 2, 2025 at 1:33 pm #16887364

romanT-13

Hi Otto.
Unfortunately there is no log recorded. I can reproduce the bug at any time. If I enable translation for my custom post type I cannot get to Translation Management menu as I get critical error warning. If I disable them, it works.
As for the word count, I only get 2 or 3 words counted, probably only the title, no Bricks entered content is counted...
Let me know how to proceed.
Best regards,
Aurel

April 2, 2025 at 2:06 pm #16887512

romanT-13

I managed to get the log:

[02-Apr-2025 14:05:19 UTC] PHP Fatal error: Uncaught TypeError: WPML\Core\SharedKernel\Component\Post\Application\Query\Dto\PostTypeDto::__construct(): Argument #5 ($hierarchical) must be of type bool, null given, called in /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Legacy/Component/Post/Application/Query/TranslatableTypesQuery.php on line 108 and defined in /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Core/SharedKernel/Component/Post/Application/Query/Dto/PostTypeDto.php:26
Stack trace:
#0 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Legacy/Component/Post/Application/Query/TranslatableTypesQuery.php(108): WPML\Core\SharedKernel\Component\Post\Application\Query\Dto\PostTypeDto->__construct()
#1 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Legacy/Component/Post/Application/Query/TranslatableTypesQuery.php(82): WPML\Legacy\Component\Post\Application\Query\TranslatableTypesQuery->buildItemTypeDetails()
#2 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Legacy/Component/Post/Application/Query/TranslatableTypesQuery.php(34): WPML\Legacy\Component\Post\Application\Query\TranslatableTypesQuery->buildCollection()
#3 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Core/Component/Dashboard/Application/DashboardController.php(205): WPML\Legacy\Component\Post\Application\Query\TranslatableTypesQuery->getTranslatable()
#4 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Core/Component/Dashboard/Application/DashboardController.php(331): WPML\UserInterface\Web\Core\Component\Dashboard\Application\DashboardController->getTranslatableItems()
#5 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/CompositionRoot/Config/Config.php(198): WPML\UserInterface\Web\Core\Component\Dashboard\Application\DashboardController->initialScriptData()
#6 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/CompositionRoot/Config/Config.php(132): WPML\UserInterface\Web\Infrastructure\CompositionRoot\Config\Config->loadScripts()
#7 /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/WordPress/CompositionRoot/Config/AdminPage.php(20): WPML\UserInterface\Web\Infrastructure\CompositionRoot\Config\Config->onLoadPage()
#8 /home/ciqu3561/students-at-heart.lu/wp-includes/class-wp-hook.php(324): WPML\UserInterface\Web\Infrastructure\WordPress\CompositionRoot\Config\AdminPage->WPML\UserInterface\Web\Infrastructure\WordPress\CompositionRoot\Config\{closure}()
#9 /home/ciqu3561/students-at-heart.lu/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#10 /home/ciqu3561/students-at-heart.lu/wp-includes/plugin.php(517): WP_Hook->do_action()
#11 /home/ciqu3561/students-at-heart.lu/wp-admin/admin.php(237): do_action()
#12 {main}
thrown in /home/ciqu3561/students-at-heart.lu/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Core/SharedKernel/Component/Post/Application/Query/Dto/PostTypeDto.php on line 26

April 2, 2025 at 2:54 pm #16887694

Otto
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks for the debug info.

The error message indicates that the ‘hierarchical’ argument receives a Null value instead of a Boolean. This can occur if the custom post types are registered without explicitly setting the ‘hierarchical’ parameter.

Verify Custom Post Type Registration:
• Ensure that both ‘News’ and ‘governance’ post types are registered with the ‘hierarchical’ parameter explicitly set to either true or false. If this parameter is omitted, it may default to null, leading to the error you’ve encountered.

Regarding the word count, does the issue only happen with these post-type content, or does it also happen in regular posts/pages?

Best Regards,
Otto

April 3, 2025 at 7:43 am #16890250
romanT-13

Thank you Otto, it seems there is a bug in ACPT and I will report it to the author, after your suggestion, enabling and disabling hiearachial option, everything works, so as you said, default is off but not explicitly set. I will report this so thank you!

Word count happens only on Bricks pages where all of the content is entered inside Bricks builder so the Gutenberg side is empty, custom post types like News is counted correctly (probably because everything is entered inside Gutenberg)..

New threads created by Otto and linked to this one are listed below:

https://wpml.org/forums/topic/wrong-wordcount-in-pages-created-with-brick/

April 3, 2025 at 12:21 pm #16892124

Otto
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Great, I am glad to hear that.

As the original issue is resolved, I created a new ticket for this other question.

Let's follow up here:
https://wpml.org/forums/topic/wrong-wordcount-in-pages-created-with-brick/

I am closing this one.

Best Regards,
Otto