Getting error when clicking Index Now

Created on 5 March 2024, 4 months ago
Updated 6 March 2024, 4 months ago

Getting the below error when clicking Index Now

Error: Call to a member function getFields() on null in Drupal\appsearch\Utility\Database::prepareNodeToIndex() (line 60 of /app/docroot/modules/contrib/elastic_enterprise_search/modules/appsearch/src/Utility/Database.php)

This happens when the Language Code for the node is 'pt-br' or 'es-mx'.
filter_var($node_id, FILTER_SANITIZE_NUMBER_INT) does not work in those cases to get the node id.

🐛 Bug report
Status

Needs review

Version

2.2

Component

Code

Created by

🇮🇳India ashraf.hussain Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ashraf.hussain
  • 🇮🇳India ashraf.hussain Bangalore

    Uploading patch for resolving the above issue.

  • Status changed to Needs review 4 months ago
  • 🇮🇳India ashraf.hussain Bangalore

    Uploading the patch for fixing the error when clicking Index Now.
    1. Error: Call to a member function getFields() on null in Drupal\appsearch\Utility\Database::prepareNodeToIndex() (line 60 of /app/docroot/modules/contrib/elastic_enterprise_search/modules/appsearch/src/Utility/Database.php)

    The above error happens when the Language Code for the node is 'pt-br' or 'es-mx'.
    filter_var($node_id, FILTER_SANITIZE_NUMBER_INT) does not work in those cases to get the node id.

    2. Error: Call to a member function getFileUri() on null in Drupal\appsearch\Utility\Database::mapFieldValues() (line 110 of /app/docroot/modules/contrib/elastic_enterprise_search/modules/appsearch/src/Utility/Database.php

    The above error happens when the $field->entity is empty.

    Both the issue are resolved in this patch.

Production build 0.69.0 2024