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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: America/Los_Angeles (GMT-08:00)
Tagged: Exception, Known issue
Author | Posts |
---|---|
January 22, 2024 at 9:26 pm | |
jean-francoisS-2 |
I have a website with ACF + WPML installed. When I save posts that have a translation made with the "Duplicate" button from WPML, I get this error: PHP Fatal error: Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, array given in /var/web/site/public_html/wp-content/plugins/wpml-string-translation/classes/filters/strings-filter/class-wpml-register-string-filter.php:205 |
January 22, 2024 at 10:30 pm | |
January 22, 2024 at 11:32 pm #15213812 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hello, I am working on reproducing the issue on the staging site. - I have gone to pages and added a new page called WPML test - Added an ACF for textre image and published - Switched to EN and added content then published I got no error and the content I added remains after a reloadd. Then I tried again but this time after adding the ACF twice, but I got the same results. Am I missing a step? Please review and update me. |
January 23, 2024 at 2:36 pm #15217724 | |
jean-francoisS-2 |
Hello, When creating the page in English, we want to duplicate the page (and not only add a translation). When doing so (I did a test with the page you've created), the second time a block is use (for this example, I've used Membres), the fields are empty when reloading the admin. You can check with WPML TEST and WPML TEST EN (which are both fr and en respectively). I suspect the problem is caused with the repeater and WPML is not capable of putting a unique identifier to both blocks. Sorry for the delay, we seem to be on different timezone 🙂 |
January 23, 2024 at 8:46 pm #15218840 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Thank you for updating me! I was able to see the issue with the membres block. However, I am not able to reproduce with a new acf block added through ACF field groups, for example the WPML block is added to the membres block and it works OK. How are the fields Ancre and Titre added? I wonder if this has possibly something to do with code configuration, are these added using custom code? |
January 23, 2024 at 9:02 pm #15218918 | |
jean-francoisS-2 |
Ancre and Titre are Clones that we add on each block, because we use them has partial in our code. You think it's because we use clones ? |
January 23, 2024 at 10:46 pm #15219146 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
It is hard to tell, the best way would be to review the code used to add the acf block, at the moment the issue is pointing toward the custom code as this issue does not happen with standard ACF fields. Please share this with me to further review and how you would add this block if you had to re produce the issue in a clean environment |
January 24, 2024 at 2:06 pm #15222205 | |
jean-francoisS-2 |
Here's how we register our blocks : <?php //Register the block with ACF //Create Block categories $categories[] = array( $categories[] = array( $categories[] = array( return $categories; //Allowed block to be used Then we create an inactive block which will be use as an anchor tag and if the user wants to show the block or not. Finally, we use this acf has a clone in other blocks to not redo the same acf over and over again. After this, we only add blocks with the page builder of wordpress. The thing I don't understand is that we don't use custom code for the ACF, we use the standard Clone field inside ACF. |
January 24, 2024 at 5:47 pm #15223211 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Thank you very much for sharing this information! I have discussed this with our team and it looks like there is a known issue that would cause the behavior you are experiencing. Please review the following documentation, try the workaround, and let me know your results |
The topic ‘[Closed] Uncaught TypeError: strlen()’ is closed to new replies.