Problem/Motivation

When invoking the getRealpath() function in Drupal's Search API Attachments module, an error is encountered:
Error: Call to a member function getExternalUrl() on bool in Drupal\search_api_attachments\TextExtractorPluginBase->getRealpath() (line 155 of modules/contrib/search_api_attachments/src/TextExtractorPluginBase.php).
This error occurs when the $wrapper variable is evaluated as a boolean (bool) value (false) instead of an object.

Steps to reproduce

Run the site system cron.

Proposed resolution

Add appropriate error handling in the code to handle scenarios where the wrapper cannot be retrieved ($wrapper evaluates to false) and return null.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

CommentFileSizeAuthor
#4 3374865-3.patch670 bytesmohammad-fayoumi
#2 3374865-2.patch674 bytesmohammad-fayoumi

Comments

Mohammad-Fayoumi created an issue. See original summary.

mohammad-fayoumi’s picture

StatusFileSize
new674 bytes
mohammad-fayoumi’s picture

Status: Active » Needs review
mohammad-fayoumi’s picture

Status: Needs review » Active
StatusFileSize
new670 bytes
mohammad-fayoumi’s picture

Status: Active » Needs review

  • 4a357814 committed on 9.0.x
    Issue #3374865 by mohammad-fayoumi, izus: Call to a member function...
izus’s picture

Status: Needs review » Fixed

merged
thans

izus’s picture

Status: Fixed » Closed (fixed)