Bug #57906

Calling delete() on a file-object throws exception

Added by Stefan Froemken about 7 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2014-04-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Hello Core-Team,

I'm calling delete() on a file-object in one of my extbase extensions. This results in:

There is no entry in the $TCA array for the table "sys_file_processedfile". This means that the function enableFields() is called with an invalid table name as argument.

I just searched the TCA and I can confirm that there is no entry for sys_file_processedfile.
You call following line in ProcessedFileRepository:

$whereClause = 'original=' . (int)$file->getUid() . $this->getWhereClauseForEnabledFields();

In my opinion the part with enableFields is wrong here.

Stefan

#1

Updated by Gerrit Code Review about 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29461

#2

Updated by Markus Klein about 7 years ago

Do you want to delete the processed file or the original file?

#3

Updated by Stefan Froemken about 7 years ago

I want to delete the original file and it seems that you have added a signalSlot where all relations regarding this file will also be deleted.

#4

Updated by Frans Saris about 7 years ago

Hi you are right about the signal/slot part.
In wich context are you deleting the file? As deleting a file in be does not give this error right?

Gr. Frans

#5

Updated by Stefan Froemken about 7 years ago

Hello Frans,

I'm calling delete() in TYPO3_MODE===FE.

Please have a look into getWhereClauseForEnabledFields() of AbstractRepository. As you can see you have a context check there. If we are in FE-Mode you're calling sys_page->enableFields which needs a valid TCA-entry. And in BE-Mode you're calling BEenableFields which also does a check for a valid entry, but if nothing is found, it returns a simple empty string and doesn't break functionality.

Stefan

#6

Updated by Frans Saris about 7 years ago

As all other methods in the ProcessedFileRepository also ignore the getWhereClauseForEnabledFields() I think it is okay to remove it here and not change getWhereClauseForEnabledFields() to not fail when this is called without a TCA for the table present.

#7

Updated by Stefan Froemken about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#8

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF