Project

General

Profile

Actions

Bug #56442

closed

Invalid FileReference used

Added by Xavier Perseguers over 10 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Category:
Extbase
Target version:
Start date:
2014-02-28
Due date:
% Done:

100%

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

Description

In my domain model (watches) I have this:

family (1:n) familyLine (1:n) watch (1:1) image

Thus a family has some familyLines which in turns have watches and each watch has an associated image (FileReference).

As "image" is a FileReference, column "image" from table "watch" is a counter of how many references are associated, thus "1" in my case since there is only one allowed image to be linked.

familyLines are lazy loaded, watches too and image reference as well.

When I loop over my families in the view, I basically do this:

foreach families as family
    foreach family.familyLines as familyline
        show familyline.<first-reference>.image
    endforeach
endforeach

Now, the first image to be loaded will put the corresponding FileReference's uid into memory. In my case this happens to be sys_file_reference row with uid=1. When I loop over the second picture to be retrieved (from lazy loading), it has to map value "1" (which actually is not a uid but a counter) as a FileReference and as such it finds the first FileReference that was retrieved before and it does not load the actual FileReference but the previous one.

In the end this means that it shows the first image instead of the real one.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #53514: Extbase: DataMapper causes redundant queriesClosedNico de Haen2013-11-11

Actions
Related to TYPO3 Core - Bug #99505: Useless SQL queries in extbase DataMapperClosedMarkus Klein2023-01-10

Actions
Actions

Also available in: Atom PDF