Islandora / controlled_access_terms

Drupal module for subject and agents
GNU General Public License v2.0
7 stars 28 forks source link

Adding a null check for the $paragraph_entity #128

Closed nchiasson-dgi closed 5 days ago

nchiasson-dgi commented 1 week ago

GitHub Issue: N/A

What does this Pull Request do?

The $paragraph_entity variable could be set as null and then immediately have a member function attempt to be called on it, resulting in the following error:

Fatal error: Uncaught Error: Call to a member function hasField() on null in /path/to/files/controlled_access_terms/src/Plugin/search_api/processor/EDTFYear.php:254

What's new?

Adding a null check for the $paragraph_entity.

How should this be tested?

Enabling the EDTF Year processor and indexing the edtf_year field.

Interested parties

@Islandora/committers