xperseguers / t3ext-extractor

TYPO3 Extension extractor
https://extensions.typo3.org/extension/extractor
GNU General Public License v2.0
15 stars 24 forks source link

Metadata extraction fails on file upload #33

Open rtp-cgs opened 3 years ago

rtp-cgs commented 3 years ago

Dear Xavier,

Some of the times when I upload a file in the Filelist module the metadata extraction does not work. The issue seems to be related the fields tstamp and crdate sometimes at the point of the extraction the tstamp value is 1 bigger than the crdate and therefore the metadata is ignored. See: Classes/Service/Extraction/AbstractExtractionService.php:162

The uploaded file does not seem to make any difference, there have been both successful and failed extractions with the same file. We are using a Typo3 9.5.23 non-composer installation and the ext:extractor version 2.1.0. If you need any more information about the setup please let me know.

If you have any idea/hint what we might be doing wrong we would appreciate.

Best Regards, Cyrill

sypets commented 1 year ago

I noticed this too. As far as I can tell this is intentional but may not always work as intended.

While testing, for some of the files crdate=tstamp after upload (I deactived automatic metadata abstraction). Sometimes it is not, I am not really sure why.

The extension will refuse to extract if sys_file_metadata crdate != tstamp. This is a work-around for a core bug:

with change, see AbstractService::canProcess()

DecideGmbH commented 6 months ago

Today I ran into the same problem and debugged my way through the extension until I found this flaw. I coded my way around it by not checking if the crdate and tstamp are the same, but if there are more 3 seconds between them. In my opinion, that's enough, to not have changed the data by hand. This working for me so far. Is there any chance to get this change into this extension?

\typo3conf\ext\extractor\Classes\Service\Extraction\AbstractExtractionService.php Line: 162 // if (!empty($metadata) && $metadata['crdate'] !== $metadata['tstamp']) { if (!empty($metadata) && $metadata['tstamp'] > ((int)$metadata['crdate'] + 3)) {