I am trying to:
Edit a page using the layouts editor
Link to a page where the issue can be seen:
hidden link
I expected to see:
The layout editor screen where I can choose which block of content to edit.
Instead, I got:
Warning: count(): Parameter must be an array or an object that implements Countable in [path]/wp-content/plugins/layouts/inc/gui/editor/editor.php on line 910
I see these errors when I try to edit the Content Layout for "Triangle Rose":
Warning: count(): Parameter must be an array or an object that implements Countable in .../plugins/layouts/inc/gui/editor/editor.php on line 910
Warning: Cannot modify header information - headers already sent by (output started at .../plugins/layouts/inc/gui/editor/editor.php:910) in .../wp-includes/option.php on line 919
Warning: Cannot modify header information - headers already sent by (output started at .../plugins/layouts/inc/gui/editor/editor.php:910) in .../wp-includes/option.php on line 920
I checked that line of code locally and I receive an empty array, but it's an array, hence the code does not throw the error here.
I cannot see the same error on your site either, if I repeat the steps when in the native default English language, or edit a Template Layout.
It seems to happen only if you try to edit the content layout from within the translated version of the post, and that is not suggested, as you would translate layouts like this, instead:
https://toolset.com/documentation/translating-sites-built-with-toolset/translating-layouts/
I do see that you follow a workflow that we do as well document, but as mentioned, it's not recommended:
https://toolset.com/documentation/translating-sites-built-with-toolset/translating-layouts/#editing-the-page-layout-for-other-languages
Now, I tried to replicate that scenario locally, but cannot see the error either with or without translating the content like this.
Could you test this with no other plugins but Toolset and WPML, and a native Theme?
I would recommend these tests on a staging site.
If the issue persists, please send me a copy of that site, if possible
https://toolset.com/faq/provide-supporters-copy-site/
If the issue's solved, please let me know what plugin's causing it (or theme).
Hello,
I can see the same problem with your website database dump file in my localhot, but it seems this problem only exists in that french page "Triangle Rose".
If it is, you can try to create a new page to replace it, for example:
1) Dashboard-> WPML-> Settings,
section "How to translate posts and pages" choose option "Create translations manually"
2) Edit the problem French page "Triangle Rose", in section "Language", option "This is a translation of ", choose "none" and save. it will disconnect it with the English version page
3) Edit the English version page "The Pink Triangle", and add a new French translation, and test again.
Found a work-around but I fear the problem will recur.