Feature #28794
closed
currentVal in css_styled_content
Added by Christian Welzel over 13 years ago.
Updated about 7 years ago.
Category:
Content Rendering
Description
Hi there,
in css_styled_content in render_textpic() line 647 the current value of the cObject
is set to the current filename in the loop. Thats fine.
In line 822 a similar loop is done, but in this case currentVal is NOT set to the
filename of the image currently processed.
Is this intentional or a bug?
I try to extend getData() of cObject but during rendering i always get the last
value of the first loop as currentVal.
Btw: Instead of using
$this->cObj->data[$this->cObj->currentValKey] = $totalImagePath;
it would be much more OOP to use
$this->cObj->setCurrentVal($totalImagePath);
Thx
- Status changed from New to Accepted
- Complexity set to medium
- Target version changed from 4.6.0-beta2 to 4.6.0-beta3
- Target version changed from 4.6.0-beta3 to 4.6.0-RC1
Looks like a missing feature, but it would be cool to see why you need this in the second loop. Any example extension or use-case that you can present that would require this? If you can add the reasoning for it and even provide a patch to our review system, I would see no problem in getting it into the core.
Changing the code to:
$this->cObj->setCurrentVal($totalImagePath);
makes sense. I guess by the time it was introduced (back in 2006) there was no such method. :)
I made an extention which uses the getData-Hook to provide the values of fields of DAM records to TS. This way, the developer can access the values using 10 = TEXT, 10.data = dam:title. The ext is in TER as dam_getdata.
The problem is: when using this in combination with IMGTEXT of css_styled_content, image sizes are calculated in the first loop (where currentVal is set) but the rendering of html is in the second loop, where currentVal is not set. And this is the place where things like captions are calculated. So if i retrieve the dam:title from currentVal, i always get the title of the last file (its a leftover of the first loop). I found out, that the register ORIG_FILENAME is set in both loops, so i integrated a switch into the EXT for this special case. But it would be more logical to set the currentVal in the second loop.
I'm not familar how the review system works.
The patch would be to add
$this->cObj->setCurrentVal($origImages[$imgKey]['origFile']);
somewhere around line 828.
- Target version changed from 4.6.0-RC1 to 4.6.0
Christian: Thanks for the insight.
For contributing with a review request, please check out this resource:
http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine#Starting_a_new_Change_Request_.28RFC.29
Read the whole page to get the idea on how it works. Follow the steps one by one with attention to all details, and this will provide us with a revieweable patch request which can easily be merged into the core if it is ok.
Right now our "master" branch is in a Release Candidate phase, which means that we should avoid to add new features or tweaks for the sake of stability of the release. So I would propose we wait until this phase is over (with the release of 4.6.0) and continue by then.
Thanks!
- Target version changed from 4.6.0 to 4.6.1
- Tracker changed from Bug to Feature
- Target version changed from 4.6.1 to 4.7.0
- Status changed from Accepted to Under Review
Patch set 1 of change I335bb2f744f9352428f6b0d1931ccf2d80f45bb6 has been pushed to the review server.
It is available at http://review.typo3.org/6676
Patch set 2 of change I335bb2f744f9352428f6b0d1931ccf2d80f45bb6 has been pushed to the review server.
It is available at http://review.typo3.org/6676
- Target version changed from 4.7.0 to 4.7.0-alpha1
- Target version changed from 4.7.0-alpha1 to 4.7.0-alpha2
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF