Errors relating to $this->entity returning a boolean

Created on 29 November 2023, 12 months ago
Updated 5 September 2024, 3 months ago

We have a client project where harvesting fails with the following error:

> drupal_1 | 2023/11/29 18:10:28 [error] 283697#283697: *156851 FastCGI sent in stderr: "PHP message: Error: Call to a member function hasField() on bool in /var/www/drupal/web/modules/contrib/rest_oai_pmh/src/Plugin/rest/resource/OaiPmh.php on line 553 #0 /var/www/drupal/web/modules/contrib/rest_oai_pmh/src/Plugin/rest/resource/OaiPmh.php(537): Drupal\rest_oai_pmh\Plugin\rest\resource\OaiPmh->getHeaderById()

Once I caught a boolean value at that location, the same error was presented inside of "getRecordMetadata."

I have created the attached patch which simply handles this situation without attempting to find the root cause of why $this->entity is returning a boolean in the first place.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States noahwsmith

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

Comments & Activities

Production build 0.71.5 2024