table-string.php. Error message: Uncaught TypeError: stripos()
-
Dear community, hope you can help with the issue I’m facing
The /admin.php?page=mlang_strings persistently shoots the error There has been a critical error on this website. Please check your site admin email inbox for instructions. (see more details below)
I’ve re-installed Polylang but that didn’t fix the matter.
Any workable solution is much appreciated.
Thanks
***
WordPress version 6.3.2
Active theme: Blocksy Child (version )
Current plugin: Polylang (version 3.5.1)
PHP version 8.1.24Error Details
=============
An error of type E_ERROR was caused in line 275 of the file /home/ahrwcryk/public_html/wp-content/plugins/polylang/settings/table-string.php. Error message: Uncaught TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given in /home/ahrwcryk/public_html/wp-content/plugins/polylang/settings/table-string.php:275
Stack trace:
#0 /home/ahrwcryk/public_html/wp-content/plugins/polylang/settings/table-string.php(275): stripos()
#1 /home/ahrwcryk/public_html/wp-content/plugins/polylang/settings/settings.php(299): PLL_Table_String->prepare_items()
#2 /home/ahrwcryk/public_html/wp-includes/class-wp-hook.php(310): PLL_Settings->languages_page()
#3 /home/ahrwcryk/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#4 /home/ahrwcryk/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#5 /home/ahrwcryk/public_html/wp-admin/admin.php(259): do_action()
#6 {main}
thrownThe page I need help with: [log in to see the link]
-
Hello,
My guess is that the error is coming from 3rd party code misusing a Polylang function.
So I invite you to switch to a default theme and deactivate all plugins, mu-plugins, custom code except Polylang. You shouldn’t have the error anymore.
Then activate your parent theme, child theme, plugins one by one until you reproduce the error.
Thank you @Chouby
Unfortunately, I wasn’t able to locate the root cause of the issue following the approach you suggested ??
Maybe you can share some other hints on how to locate the source of the issue and get it resolved
Dear @chouby,
I was trying to find the source of the error – disabling the plugins and changing the theme to dafault didn’t resolve the issue
Could this somehow be related to the following changes that I’ve recently made:
– replacing mysqli by nd_mysqli
– replacing collation to <dfn title=”Unicode (UCA 4.0.0), case-insensitive”>utf8mb4_unicode_ci</dfn>
If so, please advise if I need to change anything in the Polylang settingsI see no other potential reasons for the error, your advise is much appreciated
Dear @chouby,
Just wondering if you had a chance to look into my issue?
please see below the fragment of the code of /wp-content/plugins/polylang/settings/table-string.php
line 275 (which triggers an error) is highlighted in bold// Filter by searched string $s = empty( $_GET['s'] ) ? '' : wp_unslash( $_GET['s'] ); // phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput if ( ! empty( $s ) ) { // Search in translations $in_translations = $this->search_in_translations( $mo, $s ); foreach ( $data as $key => $row ) { if ( stripos( $row['name'], $s ) === false && stripos( $row['string'], $s ) === false && ! in_array( $row['string'], $in_translations ) ) { unset( $data[ $key ] ); } } }
Your advice is much appreciated
Hello @chouby,
it would be great to get any feedback from you. Thanks
I gave to you my best hint. The most probable is that the error is coming from 3rd party code. Because at this line Polylang one variable is an array instead of a string. The strings there are generally added with
pll_register_string()
. If you wrote some custom code related to Polylang in a custom plugin or a child theme, I invite you to check your code.Hello?@chouby,
I’m afraid the issue is not on the 3rd party side – I’ve created the staging site where I disabled all plugins (apart from Polylang) and applied the default theme, but the issue still persists (see the screenshot)
Would you be able to provide any help? If needed, I can give you access to the staging so you can investigate further.
Thanks in advance,
Igor
@itonic has reported the same kind of error in https://www.ads-software.com/support/topic/critical-error-605/
His video helped me to better understand the issue.
My current guess is that Blocksy persistently registers an array instead of a string expected by Polylang. This can be done using our WPML compatibility API. I can confirm from the code that Blocksy is using the WPML API to register strings. I however could not trigger this code from the interface as I don’t know the theme.This wrong data is then stored in the database. Once it’s there, the error persists even if the theme is switched to another one.
To further debug, I would need you to get from the database (with phpmyadmin) the value of the optionpolylang_wpml_strings
. Please copy paste it here (it’s very important not to forget a single character to avoid data corruption). Hopefully it will help me to know more about this wrong data.
@chouby
Thanks for this info. I sent this to the Blocksy team.
RegardsHello?@chouby,
Please see polylang_wpml_strings value below
a:53:{s:32:”b0e12103a2b42f72cbf12501d94fa301″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:27:”header:type-1:logo:blogname”;s:6:”string”;s:8:”Business”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”306d2ce20c60dd5e9e8528122433492f”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:34:”header:type-1:logo:blogdescription”;s:6:”string”;s:27:”Just another WordPress site”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”37e24a4a3b69bb2968be9d71b10667ff”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:39:”header:type-1:button:header_button_text”;s:6:”string”;s:11:”Take Action”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”3d1649ecefbf2ae899e0bca161aff819″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:39:”header:type-1:button:header_button_link”;s:6:”string”;s:1:”#”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”bc5070bb9eb4c5ff376ca0a415336842″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:27:”blog_archive_read_more_text”;s:6:”string”;s:25:”Читати б?льше”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”273fa15c762718cb090641289ca3d17d”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:33:”categories_archive_read_more_text”;s:6:”string”;s:25:”Читати б?льше”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”dec62606933c17b3485e0f1fff440c83″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:38:”footer:type-1:copyright:copyright_text”;s:6:”string”;s:46:”
Copyright ?{site_title} {current_year}”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”0f38456dc5c433718ef00fad1ebd3e97″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:36:”footer:type-1:contacts:contact_items”;s:6:”string”;a:4:{i:0;a:6:{s:2:”id”;s:5:”phone”;s:7:”enabled”;b:1;s:5:”title”;s:20:”Phone/Viber/WhatsApp”;s:7:”content”;s:13:”+380504457080″;s:4:”link”;s:17:”tel:+380504457080″;s:4:”__id”;s:21:”q5ij2s8eAVN_MzvzpaJ4C”;}i:1;a:6:{s:2:”id”;s:5:”email”;s:7:”enabled”;b:1;s:5:”title”;s:5:”Email”;s:7:”content”;s:15:”[email protected]”;s:4:”link”;s:22:”mailto:[email protected]”;s:4:”__id”;s:21:”pp659x4n1wL7hFcaGgDt7″;}i:2;a:6:{s:2:”id”;s:6:”mobile”;s:7:”enabled”;b:1;s:5:”title”;s:8:”Telegram”;s:7:”content”;s:13:”+447459070288″;s:4:”link”;s:26:”https://t.me/AnnaVasiukhno”;s:4:”__id”;s:21:”3NFTsv5Y083QFbB71ynO3″;}i:3;a:6:{s:2:”id”;s:7:”website”;s:7:”enabled”;b:1;s:5:”title”;s:18:”Facebook messenger”;s:7:”content”;s:4:”A-HR”;s:4:”link”;s:21:”https://m.me/ahr.profi”;s:4:”__id”;s:21:”jJSp02THYrxihwbtdi0tZ”;}}s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”6119b05f65d03eb28052ca295de2275a”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:34:”single_blog_post_hero_custom_title”;s:6:”string”;s:4:”Home”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”764c5eb8612f7e9b2b12e1a144658ae3″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:48:”footer:type-1:contacts:contact_items:phone:title”;s:6:”string”;s:20:”Phone/Viber/WhatsApp”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”0aa638a8f2c8f2730e030208d568e84d”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:50:”footer:type-1:contacts:contact_items:phone:content”;s:6:”string”;s:13:”+380504457080″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”2eeb9c866745e3fcd213c09574acd4c0″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:47:”footer:type-1:contacts:contact_items:phone:link”;s:6:”string”;s:17:”tel:+380504457080″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”5379a94cf7c3dea9977ed89c19d8d6ec”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:48:”footer:type-1:contacts:contact_items:email:title”;s:6:”string”;s:5:”Email”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”75abb047801dc1ec8cb92566184814aa”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:50:”footer:type-1:contacts:contact_items:email:content”;s:6:”string”;s:15:”[email protected]”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”a331048cc0485e031c3f3d4b2d1c3952″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:47:”footer:type-1:contacts:contact_items:email:link”;s:6:”string”;s:22:”mailto:[email protected]”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”c9e3f155fcfd104960a2ac85dbad2ad6″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:49:”footer:type-1:contacts:contact_items:mobile:title”;s:6:”string”;s:8:”Telegram”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”8eb6e17b9bf814dd72409771fc3a02c0″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:51:”footer:type-1:contacts:contact_items:mobile:content”;s:6:”string”;s:13:”+447459070288″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”8a7b2b0d6ae9d6028bf3204a54297b40″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:48:”footer:type-1:contacts:contact_items:mobile:link”;s:6:”string”;s:26:”https://t.me/AnnaVasiukhno”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”d24d08d8e48f28c880ce48e4dc0d3ea7″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:50:”footer:type-1:contacts:contact_items:website:title”;s:6:”string”;s:18:”Facebook messenger”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”798bde95f1ae7ec5967162b197b52c5d”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:52:”footer:type-1:contacts:contact_items:website:content”;s:6:”string”;s:4:”A-HR”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”6a3a95225f69cd69700570c2ee74f296″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:49:”footer:type-1:contacts:contact_items:website:link”;s:6:”string”;s:21:”https://m.me/ahr.profi”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”1860627f95997f02f0764f3186246313″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:52:”header:type-1:text~7MBCPhjQl87Bzi8OYHx4g:header_text”;s:6:”string”;s:247:”“;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”63ba962dc8acfbb9d143a31837cbfe71″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:52:”header:type-1:text~SAcXSbaQcA8hhsovHGmOF:header_text”;s:6:”string”;s:247:”“;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”5dd5e0908a782892f3589cfd1acd80fc”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:30:”header:type-1:text:header_text”;s:6:”string”;s:95:”
ПЕРЕВЕРШУ?МО ОЧ?КУВАННЯ“;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”208bdaeabe7dd7fca7c6039487b6ab4c”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:20:”shortcuts:home:label”;s:6:”string”;s:4:”Home”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”c2af001c7c9e8412b57ff2d7f71ee817″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:21:”shortcuts:email:label”;s:6:”string”;s:5:”Email”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”61b4f84c221309ba26ea6597eb1a35da”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:21:”shortcuts:phone:label”;s:6:”string”;s:5:”Phone”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”f9fb09dcaccb2ddd6f5ad28a19ddd920″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:63:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:copyright:copyright_text”;s:6:”string”;s:46:”
Copyright ?{site_title} {current_year}”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”01475e4a3ecebb7fa492eac198e0c4ed”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:73:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:phone:title”;s:6:”string”;s:20:”Phone/Viber/WhatsApp”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”c271caf9fa9786c098900b7295603bf1″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:75:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:phone:content”;s:6:”string”;s:13:”+380504457080″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”238fefdcb31a3c6141990dad6a3dc992″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:72:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:phone:link”;s:6:”string”;s:17:”tel:+380504457080″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”388c3f1af2ef46a87dd080807a108ee9″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:73:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:email:title”;s:6:”string”;s:5:”Email”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”89c249d0d1cd423858c5ac8dbca689c9″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:75:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:email:content”;s:6:”string”;s:15:”[email protected]”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”4d82faaf8c6442f327bfefc3b4947a2d”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:72:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:email:link”;s:6:”string”;s:22:”mailto:[email protected]”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”2c741180c97338fc5124b498e7d7b688″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:74:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:mobile:title”;s:6:”string”;s:8:”Telegram”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”f5da4bde1412313649eff8f6666e5047″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:76:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:mobile:content”;s:6:”string”;s:13:”+447459070288″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”3d130dd3b49ae0935f28680f24878e3a”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:73:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:mobile:link”;s:6:”string”;s:26:”https://t.me/AnnaVasiukhno”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”76378fffd9f46b1eff39dcf927ff6d08″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:75:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:website:title”;s:6:”string”;s:18:”Facebook messenger”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”cda5761f459661e68c4dfa2dfa1d46c5″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:77:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:website:content”;s:6:”string”;s:4:”A-HR”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”a4d9bc37f5f16597a6ea0fa8e51909bb”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:74:”footer:ct-custom-9enZMsF6Z-sArUn4jfUUL:contacts:contact_items:website:link”;s:6:”string”;s:21:”https://m.me/ahr.profi”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”8fdb51a3f001677795efac3420db1fe6″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:63:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:copyright:copyright_text”;s:6:”string”;s:46:”
Copyright ?{site_title} {current_year}”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”43bbe22b72b1a574495b1e1418d26fea”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:73:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:phone:title”;s:6:”string”;s:20:”Phone/Viber/WhatsApp”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”1536e1f60c5561dcc84c1810d0d2c5df”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:75:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:phone:content”;s:6:”string”;s:13:”+380504457080″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”a70e7eeff071394fa15ef32656dcf8d7″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:72:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:phone:link”;s:6:”string”;s:17:”tel:+380504457080″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”ccbb7d2eed1a50ec4374888084735ab8″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:73:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:email:title”;s:6:”string”;s:5:”Email”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”756d64989030e5ddee1ff3480a04d139″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:75:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:email:content”;s:6:”string”;s:15:”[email protected]”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”2956694eb47e8ad3a1e6cb7637668eba”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:72:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:email:link”;s:6:”string”;s:22:”mailto:[email protected]”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”6becaacb9e2acfebda159ee49fe46b75″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:74:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:mobile:title”;s:6:”string”;s:8:”Telegram”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”2d4ffc09183a9c20711aca4440d83c7d”;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:76:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:mobile:content”;s:6:”string”;s:13:”+447459070288″;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”1cca5ed858276b6da7ecd2149c052b14″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:73:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:mobile:link”;s:6:”string”;s:26:”https://t.me/AnnaVasiukhno”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”d57a94bea285a21c050e2539cf3f6716″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:75:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:website:title”;s:6:”string”;s:18:”Facebook messenger”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”b9ae85a21fb0cf189563f0f9bdb4ba97″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:77:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:website:content”;s:6:”string”;s:4:”A-HR”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}s:32:”8b166db962e0adbe24b2e755efacd366″;a:5:{s:7:”context”;s:7:”Blocksy”;s:4:”name”;s:74:”footer:ct-custom-z3JOtBh15uVnMU45brpIR:contacts:contact_items:website:link”;s:6:”string”;s:21:”https://m.me/ahr.profi”;s:9:”multiline”;b:1;s:3:”icl”;b:1;}}
Could you please copy it in a code block or in a text file with a link to get it here? The automatic formatting of the editor is completely corrupting the data. I tried to fix it manually but there are too many errors.
Hello?@chouby,
Sure, here it is
Much better like this ??
So I found the faulty data. This is the string registered with the namefooter:type-1:contacts:contact_items
As you can see below, there is an array where we would expect a string.[0f38456dc5c433718ef00fad1ebd3e97] => Array ( [context] => Blocksy [name] => footer:type-1:contacts:contact_items [string] => Array ( [0] => Array ( [id] => phone [enabled] => 1 [title] => Phone/Viber/WhatsApp [content] => +380504457080 [link] => tel:+380504457080 [__id] => q5ij2s8eAVN_MzvzpaJ4C ) [1] => Array ( [id] => email [enabled] => 1 [title] => Email [content] => [email protected] [link] => mailto:[email protected] [__id] => pp659x4n1wL7hFcaGgDt7 ) [2] => Array ( [id] => mobile [enabled] => 1 [title] => Telegram [content] => +447459070288 [link] => https://t.me/AnnaVasiukhno [__id] => 3NFTsv5Y083QFbB71ynO3 ) [3] => Array ( [id] => website [enabled] => 1 [title] => Facebook messenger [content] => A-HR [link] => https://m.me/ahr.profi [__id] => jJSp02THYrxihwbtdi0tZ ) ) [multiline] => 1 [icl] => 1 )
Please forward this to the Blocksy team. Hopefull, this will help them to fix the issue in the theme. There are 4 elements, they must register 4 different strings.
As your data is corrupted, the best is to delete this option to avoid the fatal error. As it would come back if you activate Blocksy with the contact items. Maybe you remove these informations waiting for a theme udpate.Hello!
One of the Blocksy developers here.
Thanks a lot for the efforts with debugging this problem, the above insight has been very helpful for us to understand the root cause of it.
@chouby you are spot on with this, that’s the exact cause of this problem. We have a Contacts element coming from our Blocksy Companion plugin that has an addable box with nested fields and we need to be able to translate every field in isolation. That is why we use
pll_register_string()
call to allow for the translation of said fields.I want to emphasise that with recent versions of Blocksy, on new sites, the registering of those fields works perfectly fine (we never pass an array to Polylang). But, it seems like, by mistake, on very old sites such a string was indeed registered by us by mistake. We are sorry about this.
But I’m very curious how come this triggered a fatal error only now. Was something in Polylang changed recently about the display of the strings table maybe?
—
Anyway, in order to fix existing sites that have this problem and to ensure that this will never happen again, in the next version of Blocksy (1.9.11 — which will be out today) we will:
- Ensure we never call
pll_register_string()
with a non-string value. It will literally skip this registering that string entirely, even if somehow our logic will fail again (but I doubt it will happen) - Implement a DB migrator to clean the non-string values from the
polylang_wpml_strings
(thanks a lot @chouby, I didn’t know those strings are persisted there actually), so that you don’t have to wipe out the full field just to fix this annoying issue.
Sorry again for this issue and hope this helps.
Best,
AndreiPS: @chouby — if you need to trigger re-register of those strings from Blocksy, just go to Appearance -> Customizer, make any change and click “Publish”. We will pick it up from there and perform the regeneration.
Hello @creativethemeshq
You’re welcome ??
For your information, strings registered withpll_register_string()
are indeed not persisted.
Only those registered with the WPML APIicl_register_string()
ordo_action( 'wpml_register_single_string' )
are persisted in the option. We do that because WPML registers its strings persistently and some plugins / themes use this feature. So we are doing it too for a better compatibility.
We did not change anything for a long time around this part of the code. - Ensure we never call
- The topic ‘table-string.php. Error message: Uncaught TypeError: stripos()’ is closed to new replies.