Problem/Motivation

Here is the error message we get:

Uncaught PHP Exception Error: "Call to a member function dirname() on null" at /var/www/html/web/modules/contrib/search_api_attachments/src/Cache/Files.php line 79

Proposed resolution

The $fileSystem property of the Cache/Files class is not properly initialized.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Title: Uncaught PHP Exception Error: "Call to a member function dirname() on null" at /var/www/html/web/modules/contrib/search_api_attachments/src/Cache/Files.php line 79 » Indexing of entity with file attachments crashes when using the new File cache
Issue summary: View changes

mably’s picture

MR rolls back the removal of the promoted constructor parameters that occurred in this commit.

https://stitcher.io/blog/constructor-promotion-in-php-8

mably’s picture

Status: Active » Needs review

acbramley made their first commit to this issue’s fork.

acbramley’s picture

Status: Needs review » Reviewed & tested by the community

Pushed a small change to separate constructor params on to newlines to improve readability. This should definitely go in. I'm going to open a new issue for other issues with that class too (it's using FileSystemInterface::EXISTS_REPLACE)

izus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for this finding
it is now merged :)

  • izus committed af1b718a on 9.0.x authored by mably
    Issue #3507285 by mably: Indexing of entity with file attachments...
izus’s picture

mably’s picture

Thank you @izus for your quick response!