Home›Support›English Support›[Resolved] Bricks builder - "Invalid post type" for template and some other issues
[Resolved] Bricks builder - "Invalid post type" for template and some other issues
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing an 'Invalid post type' error when WPML was active, which disappeared upon deactivating WPML. The issue was suspected to be related to a conflict with another plugin. Solution: We recommended the client to test their site in a minimum environment by deactivating all plugins except for WPML and its add-ons. This would help identify if the issue was indeed due to a plugin conflict. The client was advised to reactivate the plugins one by one to pinpoint which one caused the issue. It was important to make a full site backup before proceeding with these steps. If the site was live, we suggested performing these procedures in a staging environment or a snapshot on a local or another server.
If you're experiencing similar issues, we recommend trying these steps to see if it resolves the problem. However, this solution might be outdated or not applicable to your specific 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. If the issue persists, 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.
Background of the issue:
I am trying to finish the Site, but some issues appear, and I am not sure if those are some WPML bugs or if I didn't set up something correctly. When I deactivate WPML, the 'Invalid post type' error doesn't appear anymore, but that's not a solution of course. Please, check my video explanation for all the details: hidden link
Symptoms:
'Invalid post type' for template and some other issues
Questions:
What could be causing the 'Invalid post type' error when WPML is active?
Are there specific settings in WPML that need to be configured to avoid this error?
There are also some other issues, such as inconsistent breadcrumbs Custom post type names, and inability to switch languages in case we choose Tours from the main menu (but in case we are on specific language - please check demonstration in the video).
We focus on one issue per ticket in our technical support forum. Otherwise, tickets can get cluttered and confusing for both users and supporters. Please select the most pressing issue; we will continue working on it.
The Bricks theme is officially compatible with WPML.
However, there are a few known issues. Please see them in the above link and see if they relate to your issues. Also, please ensure to follow the guide on working with Bricks and WPML.
Hello Itamar,
Thank you very much for your feedback.
In that case, I would focus on the first and most important issue - the error "Invalid post type" in case I wish to open Bricks template "Tours" in Bricks builder. You can check the issue description and demonstration in the video above.
P.S. I heave read guide - How to working with Bricks and WPML earlier.
To enable it, open your wp-config.php file and look for
define('WP_DEBUG', false);
Change it to:
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
After this, repeat the action that causes the problem on your site (trigger the Invlaid post type message). The errors will be saved to a debug.log log file inside the /wp-content/ directory. Then please share the errors with us.
Thank you for your feedback.
Hmm, from what I see, there is no mentioned WPML in debug file, which is weird because when I deactivate WPML there is no issue. But, maybe I don't see the "whole picture".
Please, check the debug messages:
[18-Jun-2024 17:04:02 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:02 UTC] SESSION starting
[18-Jun-2024 17:04:02 UTC] SESSION ce1tukou5jmiis8a2ve7dpeol4
[18-Jun-2024 17:04:03 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:03 UTC] PHP Warning: session_start(): Session cannot be started after headers have already been sent in /home/shimoda/public_html/izrada/sunturist-new/wp-content/plugins/eci_travelapps/eci-travelapps.php on line 19
[18-Jun-2024 17:04:03 UTC] SESSION starting
[18-Jun-2024 17:04:03 UTC] SESSION
[18-Jun-2024 17:04:04 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:04 UTC] SESSION starting
[18-Jun-2024 17:04:04 UTC] SESSION ce1tukou5jmiis8a2ve7dpeol4
[18-Jun-2024 17:04:05 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 7288
[18-Jun-2024 17:04:05 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 2187
[18-Jun-2024 17:04:06 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:06 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:06 UTC] SESSION starting
[18-Jun-2024 17:04:06 UTC] SESSION ce1tukou5jmiis8a2ve7dpeol4
[18-Jun-2024 17:04:06 UTC] SESSION starting
[18-Jun-2024 17:04:06 UTC] SESSION ce1tukou5jmiis8a2ve7dpeol4
[18-Jun-2024 17:04:08 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:08 UTC] SESSION starting
[18-Jun-2024 17:04:08 UTC] SESSION ce1tukou5jmiis8a2ve7dpeol4
[18-Jun-2024 17:04:10 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:10 UTC] SESSION starting
[18-Jun-2024 17:04:10 UTC] SESSION ce1tukou5jmiis8a2ve7dpeol4
[18-Jun-2024 17:04:11 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 6078
[18-Jun-2024 17:04:12 UTC] SESSION starting
[18-Jun-2024 17:04:12 UTC] SESSION ce1tukou5jmiis8a2ve7dpeol4
[18-Jun-2024 17:04:12 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 7288
[18-Jun-2024 17:04:12 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/shimoda/public_html/izrada/sunturist-new/wp-includes/functions.php on line 2187
This could be a collision with a third-party plugin. It might be the eci_travelapps plugin, but I can't be sure yet. Please proceed with the following procedure, we call minimum environment.
If possible, get your site into a minimum environment, Which means, in your case, deactivating all the plugins except WPML.
Please deactivate all plugins except the WPML and its add-ons. Then please check if the problem persists. If it does not continue, start by activating the plugins individually, check when the issue comes back, and then report to me which plugin was the culprit.
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
*** If your site is live, you might want to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***