Project

General

Profile

Actions

Bug #93700

closed

ClickEnlarge viewhelper uses global cObj and delivers wrong data for lightbox therefore

Added by Markus Klein over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Target version:
-
Start date:
2021-03-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Situation:

The default configuration for lightboxes in typoscript is:

linkWrap.lightboxRelAttribute = lightbox[{field:uid}]

So the generated markup refers to the uid of the current "data" in the cObj.

The rel-attribute is intended to group images to a "gallery" so the value shall be unique for this gallery.

Current behaviour:

{field:uid} delivers the uid of the current page .

Expected behaviour:

{field:uid} delivers the uid of the current content element .

Analysis:

The default implementation of the ClickEnlargeViewHelper uses the contentobject (cObj) stored in TSFE to render the imageLinkWrap for an image.
This is obviously wrong as the data stored there is the page record.

The actual cObj (for the FluidTemplate) is not reachable within the viewhelper, but the data of it is exposed in a Fluid variable.

Proposed fix:

Replace the data of the global cObj temporarily with the data from the Fluid variable, if available.

Actions #1

Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted 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/c/Packages/TYPO3.CMS/+/68310

Actions #2

Updated by Gerrit Code Review over 3 years 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/+/68473

Actions #3

Updated by Markus Klein over 3 years ago

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

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF