• Issue

    I have recently enabled your plugin as well as publishpress revisions pro while using elementor and acf fields. When I try and save a revision on a page built with elementor I was receiving the following error ::

    Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array)?must be of type array, string given in?/var/www/html/wp-content/plugins/relevanssi/lib/common.php:1374

    That line is part of the relevanssi_filter_custom_fields function. The issue does not occur if I am not creating a revision.

    The site is running on php 8.2

    Work Around ::

    I was able to work around the issue by setting the Custom fields indexing option to visible within the Relevanssi settings admin.

    Seems like a bit of an edge case but I figured I would drop you a note about it.

    Here is the stack trace ::

    1. array_map()
      /var/www/html/wp-content/plugins/relevanssi/lib/common.php:1374
    2. relevanssi_filter_custom_fields()
      /var/www/html/wp-includes/class-wp-hook.php:326
    3. WP_Hook->apply_filters()
      /var/www/html/wp-includes/plugin.php:205

    4. apply_filters()
      /var/www/html/wp-content/plugins/relevanssi/lib/indexing.php:1282

    5. relevanssi_index_custom_fields()
      /var/www/html/wp-content/plugins/relevanssi/lib/indexing.php:573

    6. relevanssi_index_doc()
      /var/www/html/wp-content/plugins/relevanssi/lib/indexing.php:832

    7. relevanssi_publish()
      /var/www/html/wp-content/plugins/relevanssi/lib/indexing.php:905

    8. relevanssi_insert_edit()
      /var/www/html/wp-includes/class-wp-hook.php:326

    9. WP_Hook->apply_filters()
      /var/www/html/wp-includes/class-wp-hook.php:348

    10. WP_Hook->do_action()
      /var/www/html/wp-includes/plugin.php:517

    11. do_action()
      /var/www/html/wp-includes/post.php:5612

    12. wp_after_insert_post()
      /var/www/html/wp-includes/post.php:4905

    13. wp_insert_post()
      /var/www/html/wp-includes/post.php:4993

    14. wp_update_post()
      /var/www/html/wp-content/plugins/elementor/core/settings/page/manager.php:352

    15. Elementor\Core\Settings\Page\Manager->save_post_status()
      /var/www/html/wp-content/plugins/elementor/core/settings/page/manager.php:122

    16. Elementor\Core\Settings\Page\Manager->ajax_before_save_settings()
      /var/www/html/wp-content/plugins/elementor/core/base/document.php:1790

    17. Elementor\Core\Base\Document->save_settings()
      /var/www/html/wp-content/plugins/elementor/core/base/document.php:849

    18. Elementor\Core\Base\Document->save()
      /var/www/html/wp-content/plugins/elementor/core/documents-manager.php:549

    19. Elementor\Core\Documents_Manager->ajax_save()

    20. call_user_func()
      /var/www/html/wp-content/plugins/elementor/core/common/modules/ajax/module.php:176

    21. Elementor\Core\Common\Modules\Ajax\Module->handle_ajax_request()
      /var/www/html/wp-includes/class-wp-hook.php:324

    22. WP_Hook->apply_filters()
      /var/www/html/wp-includes/class-wp-hook.php:348

    23. WP_Hook->do_action()
      /var/www/html/wp-includes/plugin.php:517

    24. do_action()
      /var/www/html/wp-admin/admin-ajax.php:192

    25. {main}
Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    “I was able to work around the issue by setting the Custom fields indexing option to visible within the Relevanssi settings admin.” What was the value before you changed it? All custom fields, or a specific list of custom fields?

    The problem is that there’s a custom field where the get_post_meta() function doesn’t return an array of values, as it should. If you can identify this custom field, you can then exclude it from Relevanssi indexing to get rid of this error.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.