In Glossary addFieldValues, when an item doesn't have any values for a glossary enabled field, a whole host of PHP notices and warnings appear (see below). Checking for values seems to resolve this issue.

Notice: Undefined offset: 0 in Drupal\search_api_glossary\Plugin\search_api\processor\Glossary->addFieldValues() (line 103 of modules/contrib/search_api_glossary/src/Plugin/search_api/processor/Glossary.php).

Deprecated function: Non-static method Drupal\search_api_glossary\GlossaryHelper::glossaryGetter() should not be called statically, assuming $this from incompatible context in Drupal\search_api_glossary\Plugin\search_api\processor\Glossary->addFieldValues() (line 109 of modules/contrib/search_api_glossary/src/Plugin/search_api/processor/Glossary.php).

Notice: Undefined index: grouping in Drupal\search_api_glossary\Plugin\search_api\processor\Glossary->addFieldValues() (line 109 of modules/contrib/search_api_glossary/src/Plugin/search_api/processor/Glossary.php).

Warning: array_values() expects parameter 1 to be array, null given in Drupal\search_api_glossary\GlossaryHelper->glossaryGetter() (line 17 of modules/contrib/search_api_glossary/src/GlossaryHelper.php).

Comments

blake.thompson created an issue. See original summary.

blake.thompson’s picture

Patch to check if field values are empty

blake.thompson’s picture

Status: Active » Needs review
blake.thompson’s picture

Priority: Normal » Minor

  • dakku committed cf0686d on 8.x-3.x authored by blake.thompson
    Issue #2885556 by blake.thompson: PHP Notices/Warnings When Item Has No...
dakku’s picture

Thank you Blake, this is now committed.

dakku’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.