Project

General

Profile

Actions

Feature #28794

closed

currentVal in css_styled_content

Added by Christian Welzel over 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2011-08-06
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

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

Actions #1

Updated by Susanne Moog over 12 years ago

  • Status changed from New to Accepted
  • Complexity set to medium

Has to be investigated.

Actions #2

Updated by Xavier Perseguers over 12 years ago

  • Target version changed from 4.6.0-beta2 to 4.6.0-beta3
Actions #3

Updated by Oliver Hader over 12 years ago

  • Target version changed from 4.6.0-beta3 to 4.6.0-RC1
Actions #4

Updated by Ernesto Baschny over 12 years ago

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. :)

Actions #5

Updated by Christian Welzel over 12 years ago

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.

Actions #6

Updated by Xavier Perseguers over 12 years ago

  • Target version changed from 4.6.0-RC1 to 4.6.0
Actions #7

Updated by Ernesto Baschny over 12 years ago

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!

Actions #8

Updated by Chris topher over 12 years ago

  • Target version changed from 4.6.0 to 4.6.1
Actions #9

Updated by Xavier Perseguers over 12 years ago

  • Tracker changed from Bug to Feature
  • Target version changed from 4.6.1 to 4.7.0
Actions #10

Updated by Mr. Hudson over 12 years ago

  • 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

Actions #11

Updated by Mr. Jenkins over 12 years ago

Patch set 2 of change I335bb2f744f9352428f6b0d1931ccf2d80f45bb6 has been pushed to the review server.
It is available at http://review.typo3.org/6676

Actions #12

Updated by Steffen Ritter over 12 years ago

  • Target version changed from 4.7.0 to 4.7.0-alpha1
Actions #13

Updated by Oliver Hader over 12 years ago

  • Target version changed from 4.7.0-alpha1 to 4.7.0-alpha2
Actions #14

Updated by Gerrit Code Review over 12 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/6676

Actions #15

Updated by Christian Welzel over 12 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF