Bug #93700
closedClickEnlarge viewhelper uses global cObj and delivers wrong data for lightbox therefore
100%
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.