[TYPO3] kb_nescefe and testing versioning or workspace

Tapio Markula tapio.markula at xetpoint.fi
Tue Jul 10 09:13:22 CEST 2007


Hi

B. Kraft published once kb_nescefe, which is not anymore available. I 
had some bugs and I have tried to fix them. I might deliver it among
tm_contentaccess.

the pi1-class has bug in getContentElements

function getContentElements()   {
         $showLanguage = ($GLOBALS['TSFE']->sys_language_content==0) ? ' 
AND sys_language_uid IN (0,-1)' : ' AND 
sys_language_uid='.$GLOBALS['TSFE']->sys_language_content;
                 $rows = 
$GLOBALS['TSFE']->sys_page->getRecordsByField('tt_content', 'pid', 
$GLOBALS['TSFE']->id, ' AND colPos LIKE 
\''.$this->cObj->data['uid'].'__%\'', '', 'sorting');
         $storage = array();
                 if (is_array($rows))    {
                         foreach ($rows as $row) {
// I added test if be-functions can be used
                 if($GLOBALS['TSFE']->beUserLogin) {
#$versionOL = get_class_methods('t3lib_BEfunc');
                     #$versionOL = in_array('versionol', $versionOL); // 
doesn't exist, exists workspaceol, this must be a bug
                     #if($versionOL) // nonsense because of a bug
                     #    $row = 
$GLOBALS['TSFE']->sys_page->versionOL('tt_content', $row);
                     }
                                 $storage[$row['colPos']][] = $row;
                         }
                 }
// had bug - missing return statement
         return  $storage;
       }


I get correct version for live workspace without following test.

Maybe B. Kraft thought checking in frontend rendering workspace
I didn't get contact to the author, why I ask in this list.



t3lib_div::debug($GLOBALS['TSFE']->sys_page);
gives:

[versioningPreview] =>
[versioningWorkspaceId] => 0

Well could somebody quess, what might be the correct code?

Does this have sense?

if($GLOBALS['TSFE']->beUserLogin) {
					#t3lib_div::debug($GLOBALS['TSFE']->sys_page);
#[versioningPreview] =>
#[versioningWorkspaceId] => 0
$workspaceOL = get_class_methods('t3lib_BEfunc');
$workspaceOL = in_array('workspaceol', $workspaceOL);
if($workspaceOL)
	t3lib_BEfunc::workspaceOL('tt_content', $row);	
}



More information about the TYPO3-english mailing list