Перейти к содержанию Перейти к боковой панели

Эта тема решена. Вот описание проблемы и ее решения.

Проблема:
Клиент столкнулся с ошибкой при попытке создать HTML карту сайта через шорткод на странице. Ошибка выглядела следующим образом:

Fatal error: Uncaught Exception: item should be a Collection or an array or an object...

Решение:
1. Мы рекомендуем обновить плагин WPML до последней версии 4.6.7 и дополнения, чтобы воспользоваться последними исправлениями ошибок и улучшениями. Инструкции по обновлению можно найти здесь: http://wpml.org/faq/install-wpml/. Перед обновлением не забудьте сделать резервную копию базы данных, например, с помощью плагина http://wordpress.org/plugins/duplicator/.
2. Если проблема не исчезнет после обновления, попробуйте следующие шаги:
- Деактивируйте WPML SEO и удалите его с вашего сайта WordPress.
- Скачайте свежую копию WPML SEO с https://wpml.org/account/downloads/ и установите, затем активируйте её.
- Если проблема сохраняется, деактивируйте все плагины, не связанные с WPML и Rank Math SEO, и проверьте, решит ли это проблему.
- Проверьте проблему, используя любую стандартную тему.
Не забудьте сделать резервную копию базы данных перед внесением изменений.
Если эти решения не кажутся релевантными, пожалуйста, откройте новый тикет поддержки здесь.

Это форум технической поддержки WPML – плагина для многоязычной WordPress.

Доступно для чтения всем, но только клиенты, купившие WPML, могут оставлять сообщения. Сотрудники WPML отвечают на сообщения форума 6 дней в неделю, 22 часов в сутки.

Помечено: 

Эта тема содержит 5 ответов, имеет 2 голоса.

Последнее обновление: Andrey 1 год, 9 месяцев назад.

При содействии: Andrey.

Автор Посты
7 ноября, 2023 в 10:52 дп #14746165

yuryT-2

Я пытаюсь: создать html карту сайта через шорткод на страницу

Ссылка на страницу, где можно увидеть проблему: скрытая ссылка

Ожидалось это:

Вместо этого, получилось:

Fatal error: Uncaught Exception: item should be a Collection or an array or an object
in /www/wwwroot/dentclub.com.ua/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php on line 195

Call stack:

    WPML\FP\Obj::WPML\FP\{closure}()
    call_user_func_array()
    wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php:154
    WPML\FP\Obj::WPML\FP\{closure}()
    call_user_func_array()
    wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php:56
    WPML\FP\Obj::__callStatic()
    wp-content/plugins/wp-seo-multilingual/classes/RankMathSEO/Sitemap/Hooks.php:67
    WPML\W\R\S\Hooks::replaceHomePageInSecondaryLanguages()
    wp-content/plugins/wp-seo-multilingual/classes/RankMathSEO/Sitemap/Hooks.php:36
    WPML\W\R\S\Hooks::filterEntry()
    wp-includes/class-wp-hook.php:310
    WP_Hook::apply_filters()
    wp-includes/plugin.php:256
    apply_filters_ref_array()
    wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php:102
    RankMath\S\H\Posts::do_filter()
    wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-posts.php:162
    RankMath\S\H\Posts::generate_posts_list_flat()
    wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-posts.php:148
    RankMath\S\H\Posts::generate_posts_list()
    wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-posts.php:121
    RankMath\S\H\Posts::generate_sitemap()
    wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-sitemap.php:133
    RankMath\S\H\Sitemap::get_output()
    wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-sitemap.php:271
    RankMath\S\H\Sitemap::shortcode()
    wp-includes/shortcodes.php:433
    do_shortcode_tag()
    preg_replace_callback()
    wp-includes/shortcodes.php:273
    do_shortcode()
    wp-includes/class-wp-hook.php:310
    WP_Hook::apply_filters()
    wp-includes/plugin.php:205
    apply_filters()
    wp-includes/post-template.php:256
    the_content()
    wp-content/themes/dent-club-theme/templates/text-page.php:15
    include()
    wp-includes/template-loader.php:106
    require_once()
    wp-blog-header.php:19
    require()
    index.php:17

Query Monitor
7 ноября, 2023 в 3:29 пп #14749091

Andrey
Сторонник WPML с 06/2013

Языки: Английский (English ) Русский (Русский )

Часовой пояс: Europe/Kyiv (GMT+03:00)

Could you please update your WPML plugin to the latest version 4.6.7 and add-ons to benefit from the latest bug fixes and improvements? This may not necessarily resolve your problem, however, in order to troubleshoot the issue best we need to work on the latest code available.

You can check the latest released versions under "My Account -> Downloads" on this site. Instructions to update can be found here: http://wpml.org/faq/install-wpml/

Please remember to backup your database first before you proceed. You can use a plugin for this if you like (example: http://wordpress.org/plugins/duplicator/)

Let me know if the issue persists after an update has been done.

8 ноября, 2023 в 8:34 дп #14753589

yuryT-2

I updated the plugin but it didn’t help, if I save the page the error disappears for a while but then appears again. As I understand it, this is a conflict with the RankMathSEO plugin

8 ноября, 2023 в 8:56 дп #14753887

Andrey
Сторонник WPML с 06/2013

Языки: Английский (English ) Русский (Русский )

Часовой пояс: Europe/Kyiv (GMT+03:00)

Thank you for the update. Here are some steps that you can try to resolve the issue:

1. Deactivate WPML SEO and delete it from your WordPress site.

2. Download a fresh copy of WPML SEO from https://wpml.org/account/downloads/, and then install and activate it.

3. If the issue persists, deactivate all non-WPML and Rank Math SEO-related plugins and see if that helps.

4. Test the issue using any default theme.

Please remember to backup your database before making any changes.

8 ноября, 2023 в 9:00 дп #14753983

yuryT-2

Yes this problem is in WPML SEO (error disappeared), but I think we will need it in the future when we include other languages. And I had Version 2.1.0, so replacing it I don’t think it will help

8 ноября, 2023 в 2:46 пп #14758067

Andrey
Сторонник WPML с 06/2013

Языки: Английский (English ) Русский (Русский )

Часовой пояс: Europe/Kyiv (GMT+03:00)

Please proceed with the replacement and then follow the subsequent steps. Thank you.

Прошу прощения, не обратил внимание, что запрос был на русскоязычном форуме. Можем продолжить как Вам удобно.