Bug #88021

Preview of a record related with FAL does not work when file is changed in a workspace

Added by Gianluca Strafella over 3 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2019-03-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
workspace, TYPO3 8, TYPO3 9, TYPO3 10
Complexity:
Is Regression:
Sprint Focus:

Description

Hi,
we used extbase to build an extension that show a record related with an image (managed via FAL).
We structured a model, adding a property "image" on model:

 /**
  * image
  *
  * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
  * @cascade remove
 */
 protected $image = null;

This the template fluid part, that use the image:

<f:uri.image image='{item.image}' />

When I add a record in the TYPO3 backend, workspace LIVE, all is ok.
The image is renderized well in backend, and in frotend.

After, an editor, in a workspace, edit that record and replace the LIVE image with an other image. Save the content.
When the page is showed in preview mode, appairs this error:

#1460976233: You must either specify a string src or a File object.
TYPO3Fluid\Fluid\Core\ViewHelper\Exception thrown in file
/var/www/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php in line 108.

This is the situation on database, in table 'sys_file_reference':

+--------+-----+-----------+----------+------------+---------------------+-------------+-----------+-------------+------------------+
| uid    | pid | t3ver_oid | t3ver_id | t3ver_wsid | t3ver_label         | t3ver_state | uid_local | uid_foreign | tablenames       |
+--------+-----+-----------+----------+------------+---------------------+-------------+-----------+-------------+------------------+
| 103489 | 467 |         0 |        0 |          0 |                     |           0 |    134760 |        1229 | tx_myext_mymodel |
| 103490 | 467 |         0 |        0 |          2 | INITIAL PLACEHOLDER |           1 |    134767 |        1229 | tx_myext_mymodel |
| 103491 |  -1 |    103490 |        1 |          2 | First draft version |          -1 |    134767 |        1229 | tx_myext_mymodel |
| 103492 |  -1 |    103489 |        1 |          2 | DELETED!            |           2 |    134760 |        1229 | tx_myext_mymodel |
+--------+-----+-----------+----------+------------+---------------------+-------------+-----------+-------------+------------------+

ID 1229 is the live content record uid (see column uid_foreign).
The WS records created after user update, should references the versioned record uid (ID=1230), but they reference the Live record uid. May be ?

The problem has been replicated on these TYPO3 versions:

TYPO3 8.7.24
TYPO3 9.5.5

Thank you,
Gianluca


Files

ImageViewHelper.php (5.69 KB) ImageViewHelper.php Danilo Caccialanza, 2020-06-05 09:41
List.html (740 Bytes) List.html Danilo Caccialanza, 2020-06-05 09:41

Related issues

Related to TYPO3 Core - Feature #90072: Make inline TCA fields workspace-transparent for Extbase (foreign_field and foreign_sortby)Closed2020-01-09

Actions
#1

Updated by Georg Ringer over 3 years ago

  • Subject changed from Preview of a record related with FAL does not work when file is changed in a worskpace to Preview of a record related with FAL does not work when file is changed in a workspace
#2

Updated by Danilo Caccialanza about 2 years ago

  • Tags changed from workspace, TYPO3 8.7, TYPO3 9 to workspace, TYPO3 8, TYPO3 9, TYPO3 10

I can confirm that the problem is still present also on the version 9.5.18 and 10.4.3.
To baypas the problem, we had to develop an external viewhelper to render the image...

#3

Updated by Danilo Caccialanza about 2 years ago

I enclose an example of a viewhelper to bay the problem, but it would be nice if the problem was solved in the core :)
Works for v8 and v9.

#4

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

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

#5

Updated by Danilo Caccialanza over 1 year ago

I confirm that https://review.typo3.org/c/Packages/TYPO3.CMS/+/68913 solves this issue, tested with TYPO3 10.4.15 with tag “<f:uri.image”.

#6

Updated by Gerrit Code Review over 1 year ago

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

#7

Updated by Gerrit Code Review over 1 year ago

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

#8

Updated by Gerrit Code Review about 1 year ago

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

#9

Updated by Gerrit Code Review about 1 year ago

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

#10

Updated by Benni Mack about 1 year ago

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

Updated by Benni Mack 11 months ago

  • Status changed from Resolved to Closed
#12

Updated by Christian Kuhn 6 months ago

  • Related to Feature #90072: Make inline TCA fields workspace-transparent for Extbase (foreign_field and foreign_sortby) added

Also available in: Atom PDF