Passer la navigation

[Closed] WPML search error

This support ticket is created Il y a 11 months, 3 weeks. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 3 réponses, a 1 voix.

Dernière mise à jour par Minesh Il y a 11 months, 3 weeks.

Assisté par: Minesh.

Auteur
Publications
#2812358
Screenshot from 2025-06-12 10-46-35.png

We are running WordPress version 6.7.1 on PHP 8.3.21.
We are using Toolset Access 2.9.3, WPML Multilingual CMS 4.7.1 and WPML String Translation 3.3.1.

lien caché

Our site is running just fine with the exception of aa search function, which fails and outputs:

Fatal error: Uncaught TypeError: Cannot access offset of type array in isset or empty in /var/www/html/app/web/app/plugins/toolset-access/application/models/wpml_settings.php:456 Stack trace: #0 /var/www/html/app/web/wp/wp-includes/class-wp-hook.php(324): OTGS\Toolset\Access\Models\WPMLSettings->check_language_edit_permissions(Array, Array) #1 /var/www/html/app/web/wp/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #2 /var/www/html/app/web/app/plugins/wpml-multilingual-cms/sitepress.class.php(2888): apply_filters('wpml_active_lan...', Array, Array) #3 /var/www/html/app/web/app/plugins/wpml-multilingual-cms/inc/template-functions.php(96): SitePress->get_ls_languages(Array) #4 /var/www/html/app/web/app/themes/avada/includes/lib/inc/class-fusion-multilingual.php(366): icl_get_languages('skip_missing=0') #5 /var/www/html/app/web/app/themes/avada/includes/lib/inc/class-fusion-multilingual.php(262): Fusion_Multilingual::get_available_languages_wpml() #6 /var/www/html/app/web/app/themes/avada/includes/lib/inc/class-fusion-multilingual.php(85): Fusion_Multilingual::set_available_languages() #7 /var/www/html/app/web/app/themes/avada/includes/bootstrap.php(108): Fusion_Multilingual->__construct() #8 /var/www/html/app/web/app/themes/avada/functions.php(51): require_once('/var/www/html/a...') #9 /var/www/html/app/web/wp/wp-settings.php(672): include('/var/www/html/a...') #10 /var/www/html/app/web/wp-config.php(9): require_once('/var/www/html/a...') #11 /var/www/html/app/web/wp/wp-load.php(55): require_once('/var/www/html/a...') #12 /var/www/html/app/web/wp/wp-blog-header.php(13): require_once('/var/www/html/a...') #13 /var/www/html/app/web/index.php(6): require('/var/www/html/a...') #14 {main} thrown in /var/www/html/app/web/app/plugins/toolset-access/application/models/wpml_settings.php on line 456

This seems to suggest that a fix in Toolset (toolset-access/application/models/wpml_settings.php) is needed, similar to:

public function check_language_edit_permissions( $languages, $args ) {
// ---- START PHP8 OFFSET-SAFE GUARD ----
if ( ! is_array( $languages ) ) {
return $languages;
}
foreach ( $languages as $lang_key => $lang_info ) {
if ( ! ( is_string( $lang_key ) || is_int( $lang_key ) ) || ! is_array( $lang_info ) ) {
unset( $languages[ $lang_key ] );
}
}
// ---- END PHP8 OFFSET-SAFE GUARD ----

// … rest of the original code …
}

#2812366

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share exact steps that I should follow that should help me to reproduce the issue.

Do I need to use any specific theme and what are the other configuration setup required in order to reproduce the issue?

#2812416

Hello. As mentioned, we are using WordPress version 6.7.1 on PHP 8.3.21.
We are using Toolset Access 2.9.3, WPML Multilingual CMS 4.7.1 and WPML String Translation 3.3.1.

The theme we are using is Avada. When we are launching a search on the site, e.g.
domain.com/en_EU/?s=parents&post_type%5B%5D=any&search_limit_to_post_titles=0&live_min_character=4&live_posts_per_page=10&live_search_display_featured_image=1&live_search_display_post_type=1&fs=1&lang=en_EU

We are getting this error:

Fatal error: Uncaught TypeError: Cannot access offset of type array in isset or empty in /var/www/html/app/web/app/plugins/toolset-access/application/models/wpml_settings.php:456 Stack trace: #0 /var/www/html/app/web/wp/wp-includes/class-wp-hook.php(324): OTGS\Toolset\Access\Models\WPMLSettings->check_language_edit_permissions(Array, Array) #1 /var/www/html/app/web/wp/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #2 /var/www/html/app/web/app/plugins/wpml-multilingual-cms/sitepress.class.php(2888): apply_filters('wpml_active_lan...', Array, Array) #3 /var/www/html/app/web/app/plugins/wpml-multilingual-cms/inc/template-functions.php(96): SitePress->get_ls_languages(Array) #4 /var/www/html/app/web/app/themes/avada/includes/lib/inc/class-fusion-multilingual.php(366): icl_get_languages('skip_missing=0') #5 /var/www/html/app/web/app/themes/avada/includes/lib/inc/class-fusion-multilingual.php(262): Fusion_Multilingual::get_available_languages_wpml() #6 /var/www/html/app/web/app/themes/avada/includes/lib/inc/class-fusion-multilingual.php(85): Fusion_Multilingual::set_available_languages() #7 /var/www/html/app/web/app/themes/avada/includes/bootstrap.php(108): Fusion_Multilingual->__construct() #8 /var/www/html/app/web/app/themes/avada/functions.php(51): require_once('/var/www/html/a...') #9 /var/www/html/app/web/wp/wp-settings.php(672): include('/var/www/html/a...') #10 /var/www/html/app/web/wp-config.php(9): require_once('/var/www/html/a...') #11 /var/www/html/app/web/wp/wp-load.php(55): require_once('/var/www/html/a...') #12 /var/www/html/app/web/wp/wp-blog-header.php(13): require_once('/var/www/html/a...') #13 /var/www/html/app/web/index.php(6): require('/var/www/html/a...') #14 {main} thrown in /var/www/html/app/web/app/plugins/toolset-access/application/models/wpml_settings.php on line 456

When inspecting the $post_type inside the wpml_settings.php file (line ~470), the post type is equal to array(1) { [0]=> string(3) "any" }. Is that correct?

Please advise.w

#2812522

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Well - I need exact steps that should help me to reproduce the issue.

I visit your site:
- lien caché

And at top right corner there is a search icon and when I click on it, it offers the search box and when I input any string to search box, I do not see the issue. Also, I can see only couple of URL params added on URL and with your URL there are many URL params. For example:
- lien caché

Can you please clarify exact steps I will require to follow that should help me to reproduce the issue.

The topic ‘[Closed] WPML search error’ is closed to new replies.