This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing an Error 500 when accessing the Translation Management page in your CMS, and the error log indicates a TypeError related to
PostTypeDto::__construct()
with Visual Composer PRO plugin, this might be due to the plugin registering a custom post type without proper labels, causing a conflict with WPML.
Solution:
First, ensure you back up your database and website. We recommend trying one of the following workarounds:
1. Add the following code to your theme’s functions.php file:
add_filter( 'wpml_post_type_dto_filter', function ( $postTypeObject ) {<br /> if ( is_object( $postTypeObject ) ) {<br /> $default = $postTypeObject->name ?? '';<br /> if ( ! isset( $postTypeObject->labels ) || ! is_object( $postTypeObject->labels ) ) {<br /> $postTypeObject->labels = new stdClass();<br /> }<br /> if ( empty( $postTypeObject->name ) ) {<br /> $postTypeObject->name = $default;<br /> }<br /> if ( empty( $postTypeObject->labels->name ) ) {<br /> $postTypeObject->labels->name = $default;<br /> }<br /> if ( empty( $postTypeObject->labels->singular_name ) ) {<br /> $postTypeObject->labels->singular_name = $default;<br /> }<br /> }<br /> return $postTypeObject;<br />} );2. Alternatively, manually edit the plugin file at
/wp-content/uploads/visualcomposer-assets/addons/themeEditor/themeEditor/PostTypeController.php
to ensure proper post type registration.
If these solutions do not resolve the issue or if they seem irrelevant due to updates or different configurations, 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 the problem persists, we highly recommend opening 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.