Problem/Motivation

MediaHooks::getFileExistsMode's return type is marked as int. However if FileExists class exists, it will return an enum.

Steps to reproduce

Save a media item

Proposed resolution

Update the return type

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

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

nickdickinsonwilde created an issue. See original summary.

nickdickinsonwilde’s picture

Assigned: nickdickinsonwilde » Unassigned
Status: Active » Needs review
vinodhini.e’s picture

Hi,

I tested by creating and editing Media items on Drupal 11 with the Deindex Unpublished Files module enabled, but I was unable to reproduce any runtime error. Could you provide the exact Media configuration or steps used to trigger the issue?

Thanks.

scarymonster72’s picture

I got a similar error on Drupal 10.6.12:

Drupal\deindex_unpublished_files\Hook\MediaHooks::getFileExistsMode(): Return value must be of type int, Drupal\Core\File\FileExists returned in Drupal\deindex_unpublished_files\Hook\MediaHooks->getFileExistsMode() (line 140 of modules/contrib/deindex_unpublished_files/src/Hook/MediaHooks.php)

lara_z’s picture

Status: Needs review » Fixed

This has been merged , and a new stable release has been published containing these updates.Thanks for the fixes

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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