[Typo3-dev] Bug in cObj CONTENT ?

Kraft Bernhard kraftb at gmx.net
Wed Jun 22 17:28:16 CEST 2005


Hallo List,


I'm currently making a website using TV. Before I used TV I made FE plugins for every single small
listing and such stuff ...

Now with TV I'm almost finished with the site and haven't got a single plugin ... just many fields
in the PageHeader FlexForm and some tricky FCE's.


The problem is there is some kind of reference counter for records which just get's incremented and
not decremented. I don't know if there is a reason for this or if it's a bug ... But just read on:


I tried to do the following using TS:

# ---------- SECTION "GOODIES" ----------------- BEGIN ----------------
lib.goodies_ss_startimage = CONTENT
lib.goodies_ss_startimage {
   table = pages
   select {
     pidInList = {$lib.goodies.startpage}
     orderBy = sorting
     max = 1
   }
   renderObj = CONTENT
   renderObj {
     table = pages
     select {
       pidInList.field = uid
       orderBy = sorting
       max = 1
     }
     renderObj = COA
     renderObj {
       10 = TEXT
       10.value = uploads/tx_templavoila/
       20 = TEXT
       20.postUserFunc = user_jones->getContentFlexValue
       20.postUserFunc.field = field_wallpaper_thumb
     }
   }
}

lib.goodies_ss_label = CONTENT
lib.goodies_ss_label {
   table = pages
   select {
     pidInList = {$lib.goodies.startpage}
     orderBy = sorting
     max = 1
   }
   renderObj = TEXT
   renderObj.field = title
}
# ---------- SECTION "GOODIES" ----------------- END ----------------

At the first the two cascaded CONTENT may seem a bit heavy but each of them has "max = 1" set
because I just want to retrieve Content's from the first sub-sub-page of the Container lib.goodies.startpage.

Now the problem is the following: At the start of the method "CONTENT" in class.tslib_content.php there is
the following line:
if ($originalRec) {     // If the currentRecord is set, we register, that this record has invoked this function. It's should not be allowed to do this again then!!
	$GLOBALS['TSFE']->recordRegister[$originalRec]++;
}

the TSFE value "recordRegister" seems to be kind of "reference counter" and I guess it is used so that
recursive operations are inhibited ...
But the problem is that this value gets incremented on entry in the method but not decremented on exit.

This results in my second TS cObj "lib.goodies_ss_label" never gets executed because of the line:
if (!$GLOBALS['TSFE']->recordRegister[$conf['table'].':'.$row['uid']])  {

And the record stays registered even if the method which handled it is alread done for a long time ...


When I add:
       if ($originalRec) {
          $GLOBALS['TSFE']->recordRegister[$originalRec]--;
       }

at the bottom of the "CONTENT" method it works as expected ...


greets,
Bernhard
-- 
Kraft Bernhard
MOKKA Medienagentur <http://www.mokka.at>
T: +43 - 1 - 895 33 33 - 50




More information about the TYPO3-dev mailing list