Issue Bug Closed

#59547Different identifier hashes while indexing files

Oliver Schulz 06/13/14, 14:11 updated 08/14/15, 12:23

Description

I found a bug while migrating DAM to FAL:

1) I index files via scheduler task or by just clicking some folders in file module. New files are recognized and updated. At this time the identifier hash for a record is created by “sha1_file” method.
Start:
\TYPO3\CMS\Core\Resource\Index\Indexer::processChangesInStorages()
Ends here:
\TYPO3\CMS\Core\Resource\Driver\LocalDriver::hash()

2) I index files by “$this->storageObject->getFile($identifier); This method searches for a record, when the record is missing, it will be created in this process. The difference here is the identifier hash is created by sha1 method.
Start:
\TYPO3\CMS\Core\Resource\ResourceStorage::getFile
Ends here:
\TYPO3\CMS\Core\Resource\Driver\AbstractDriver::hashIdentifier()

But the problem is now the german language, when there are umlauts in the identifier string, both methods return different hashes.

A solution for this bug is to use only one of these methods, i fixed it temporally bei changing following line:

/typo3_src/typo3/sysext/core/Classes/Resource/Driver/AbstractDriver.php:155
return sha1($identifier);
into
return $this->hash($identifier, ‘sha1’);

I know this is not the best way, but i don’t have a good overview of the FAL implementation to create a stable patch.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.