Project

General

Profile

Actions

Bug #59547

closed

Different identifier hashes while indexing files

Added by Oliver Schulz over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2014-06-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Markus Klein over 10 years ago

  • Status changed from New to Needs Feedback
  • Assignee deleted (Anja Leichsenring)

Hi Oliver!

I had a look at this issue. You're mixing two different things here.

LocalDriver::hash() is meant to get a hash of the file content, whereas
AbstractDriver::hashIdentifier() has the purpose to retrieve the hash of the identifier (alias filename).

These hashes will most likely never be equal.

I suppose the real problem here is that accidentally the wrong hash function is called.

Actions #2

Updated by Markus Klein over 10 years ago

  • Status changed from Needs Feedback to New

After looking around a bit, I can't find a problem in the Code.
What is weird in your description is that you say the problem relates to umlauts, but currently I don't get why your - IMHO wrong - fix solves the problem for you.

Actions #3

Updated by Riccardo De Contardi over 9 years ago

  • Status changed from New to Closed

the problem cannot be reproduced on current master, so I close this for now.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF