[TYPO3-core] RFC: fix bug: 6561 imgMax and imgStart (IMGTEXT) not working properly

Helmut Hummel typo3 at rampenlicht.org
Tue Oct 30 21:26:11 CET 2007


Hi Ingmar,

thanks for taking care again!

Ingmar Schlecht schrieb:
> 
> IMAGE_NUM and IMAGE_NUM_CURRENT used to be the same. Do you (or Ernesto,
> maybe) know what the difference between them is and whether or not
> IMAGE_NUM should also be set to the new value? I was just wondering
> about that when I was checking the code. I couldn't find any other
> occurence of IMAGE_NUM in the code but only some documentation at [1].

Well, why I was looking at the code in the IMGTEXT function in
tslib_content I found:

$GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgIndex;	// register
previous imgIndex
$imgIndex = $index+$a*$colCount_temp;
$GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgIndex;

There they aren't set to the same value and that's really strange
because a few lines above, when building the image array, they are set
to the same value:

for($a=0;$a<$imgCount;$a++)	{
    $GLOBALS['TSFE']->register['IMAGE_NUM'] = $a;
    $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $a;


Searching for IMAGE_NUM in the whole source, I only found occurrences in
tslib_content, pi1 class of csc. The only register the latter uses in
TS-setup code, is register:IMAGE_NUM_CURRENT, so IMAGE_NUM seems to be
something legacy...

csc always relies on IMAGE_NUM_CURRENT:

typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
altText.split.returnKey.data = register : IMAGE_NUM_CURRENT
caption.1.split.returnKey.data = register : IMAGE_NUM_CURRENT
...

And because these settings are related to the DB field containing all
captions (links, alttext, titletext), the imgStart offset has to be
added to the register.

btw. the IMGTEXT function in tslib_content seems to be broken, too, but
I have not enough nerves and time to go after this... (that's the reason
why I did not create a new patch after masi complained the faulty one).

Regards Helmut


More information about the TYPO3-team-core mailing list