In version 3 of the File Hash module, the file duplicate lookup functionality is placed in the same class as the file validation functionality. That makes it unclear how to invoke that functionality from custom modules, whereas the duplicate file lookup was easy to invoke in version 2. So I'm keeping File Hash on version 2 for now.

It'd be nice if version 3 of the module could be updated so the file duplicate lookup functionality was defined in its own service, which would restore ease of invocation from custom modules.

(The use case that concerns me here is literally retrieving the list of duplicate files, not validating files.)

Issue fork filehash-3412404

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

SpaceGoat1701 created an issue. See original summary.

mfb’s picture

@SpaceGoat1701 how about if we move it back to the main FileHash class for backwards-compatibility reasons, rather than creating a new standalone service?

spacegoat1701’s picture

I had thought there might have been other reasons for removing the functionality from the main FileHash class. But if not, or if those reasons don't supersede backwards-compatibility in your eyes, then I certainly have no problem with moving the functionality back to the main FileHash service.

mfb’s picture

Status: Active » Needs review

The method simply moved from one class to the other for consolidation purposes, but it seems useful to leave it in the main class both for backwards compatibility and to make clear that it can be used as an "API" method.

  • mfb committed 5ee9946c on 3.x
    Issue #3412404 by mfb, SpaceGoat1701: Move file duplicate lookup back to...
mfb’s picture

Status: Needs review » Fixed
mfb’s picture

Title: Create standalone service for file duplicate lookup » Move duplicateLookup() method back to filehash service

Status: Fixed » Closed (fixed)

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