Problem

When running drush cr after deleting media type this error appear : Call to a member function toArray() on null in contrib/search_api_attachments/src/Plugin/search_api/processor/FilesExtractor.php:481

Is it possible to check if entity is not empty before the toArray function in src/Plugin/search_api/processor/FilesExtractor.php file?

I'm currently making the patch.

Thanks

Comments

MaxPah created an issue. See original summary.

maxpah’s picture

StatusFileSize
new2.03 KB

Here the patch.

grimreaper’s picture

Status: Active » Needs review

  • MaxPah authored e7b06a6 on 8.x-1.x
    Issue #3072882 by MaxPah, Grimreaper, izus: Calling toArray() function...
izus’s picture

Status: Needs review » Fixed

Thanks for raising the issue and suggesting the patch
this is now merged :)

Status: Fixed » Closed (fixed)

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

sershevchyk’s picture

I still see the same error for Drupal 9.2.8 and the patch can't be applied.

Error: Call to a member function toArray() on null in Drupal\search_api_attachments\Plugin\search_api\processor\FilesExtractor->getFileFieldsAndFileEntityItems() (line 498 of modules/contrib/search_api_attachments/src/Plugin/search_api/processor/FilesExtractor.php).

sershevchyk’s picture

StatusFileSize
new1.51 KB

The patch helps me with the last problem.

izus’s picture

Version: 8.x-1.x-dev » 9.0.x-dev

Hi,
this is now merged to 9.0.x branch
thank you all