Bug #35194

Fatal error, Argument passed must be an array, boolean given.

Added by Alex Tempara about 1 year ago. Updated about 1 year ago.

Status:Resolved Start date:2012-03-23
Priority:Could have Due date:
Assignee:Jo Hasenau % Done:

0%

Category:- Spent time: -
Target version:-
TYPO3 Version: PHP Version:
Votes: 0

Description

After updating to lastest gridelements i get this very strange fatal error when i open a page in page module.

I get this error only if i open a page that contain a tt_news module. All other pages work fine.
There are grids defined, the system worked well before.

Do you have any idea whats going on?

greetings
Alex Tempara

*Uncaught TYPO3 Exception
#1: PHP Catchable Fatal Error: Argument 2 passed to t3lib_iconWorks::getSpriteIconForRecord() must be an array, boolean given, called in /www/typo3/sysext/cms/layout/class.tx_cms_layout.php on line 2210 and defined in /www/t3lib/class.t3lib_iconworks.php line 722* (More information)
t3lib_error_Exception thrown in file
/www/t3lib/error/class.t3lib_error_errorhandler.php in line 105.
11 t3lib_error_ErrorHandler::handleError(4096, "Argument 2 passed to t3lib_iconWorks::getSpriteIco…t/class.tx_cms_layout.php on line 2210 and defined", "/www/t3lib/class.t3lib_iconworks.php", 722, array)

/www/t3lib/class.t3lib_iconworks.php:

00720:   * @access public
00721:   */

00722:  public static function getSpriteIconForRecord($table, array $row, array $options = array()) {

00723:   $innerHtml = (isset($options['html']) ? $options['html'] : NULL);
00724:   $tagName = (isset($options['tagName']) ? $options['tagName'] : NULL);

10 t3lib_iconWorks::getSpriteIconForRecord("tt_content", boolean, array)

/www/typo3/sysext/cms/layout/class.tx_cms_layout.php:

02208:   // Initialization
02209:   $alttext = t3lib_BEfunc::getRecordIconAltText($row, $table);

02210:   $iconImg = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => $alttext));

02211:   $this->counter++;
02212: 

9 tx_cms_layout::getIcon("tt_content", boolean)

/www/typo3/sysext/cms/layout/class.tx_cms_layout.php:

01582: 
01583:   // Create line with type of content element and icon/lock-icon/title:

01584:   $ceType = $this->getIcon('tt_content', $row) . ' ' .

01585:     $lockIcon . ' ' .
01586:     $stat . ' ' .

8 tx_cms_layout::tt_content_drawHeader(boolean, 15, boolean, boolean)

/data/src/typo3/stable/typo3conf/ext/gridelements/lib/class.tx_gridelements_drawitemhook.php:

00429:         : 5,
00430:        $parentObject->defLangBinding && $parentObject->lP > 0,

00431:        TRUE);

00432: 
00433:       $isRTE = $parentObject->RTE && $parentObject->isRTEforField('tt_content', $itemRow, 'bodytext');

7 tx_gridelements_drawItemHook::preProcess(tx_cms_layout, boolean, "<strong><a href="#" onclick="window.location.href=…nu (Shortcut)</a> <em>[Hidden]</em></strong><br />", "", array)

/www/typo3/sysext/cms/layout/class.tx_cms_layout.php:

01730:     }
01731: 

01732:     $hookObject->preProcess($this, $drawItem, $outHeader, $out, $row);

01733:    }
01734:   }

6 tx_cms_layout::tt_content_drawItem(array, boolean)

/www/typo3/sysext/cms/layout/class.tx_cms_layout.php:

00413: 
00414:        $isRTE = $RTE && $this->isRTEforField('tt_content', $row, 'bodytext');

00415:        $singleElementHTML .= '
' . $this->tt_content_drawItem($row, $isRTE) . '
';

00416: 
00417:        // NOTE: this is the end tag for 

5 tx_cms_layout::getTable_tt_content(600)

/www/typo3/sysext/cms/layout/class.tx_cms_layout.php:

00116:      break;
00117:     case 'tt_content':

00118:      return $this->getTable_tt_content($id);

00119:      break;
00120:    }

4 tx_cms_layout::getTable("tt_content", 600, "")

/www/typo3/class.db_list.inc:

00286: 
00287:      // Finally, render the list:

00288:     $this->HTMLcode.=$this->getTable($tableName, $this->id, implode(',',$fields));

00289:    }
00290:   }

3 recordList::generateList()

/www/typo3/sysext/cms/layout/db_layout.php:

01062: 
01063:     // Generate the list of elements here:

01064:    $dblist->generateList();

01065: 
01066:     // Adding the list content to the tableOutput variable:

2 SC_db_layout::renderListContent()

/www/typo3/sysext/cms/layout/db_layout.php:

00498:     $body = $this->renderQuickEdit(); // QuickEdit
00499:    } else {

00500:     $body = $this->renderListContent(); // All other listings

00501:    }
00502: 

1 SC_db_layout::main()

/www/typo3/sysext/cms/layout/db_layout.php:

01356: 
01357: $SOBE->clearCache();

01358: $SOBE->main();

01359: $SOBE->printContent();
01360: 

History

Updated by Jo Hasenau about 1 year ago

  • Status changed from New to Needs Feedback
  • Assignee set to Jo Hasenau

Could you please provide more information about your former version?
Has this ever been working before or did you just notice it currently doesn't work?
Which TYPO3 version are you using?

Updated by Jo Hasenau about 1 year ago

  • Priority changed from Should have to Could have

At least I found out that based on the line numbers the TYPO3 version should be 4.6.x.

IMHO there should be no way to get a boolean instead of an array into the tt_content_drawHeader method unless there went something wrong with a DB query before.

in tx_gridelements_drawitemhook there is a query that fills the item array with record arrays of the children:

$result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$items = $parentObject->getResult($result);

These record arrays are then used to draw header and item within a for each loop:

foreach ($items as $itemRow) {
...
 $singleElementHTML = $parentObject->tt_content_drawHeader(
   $itemRow,
   $parentObject->tt_contentConfig['showInfo']
     ? 15
     : 5,
   $parentObject->defLangBinding && $parentObject->lP > 0,
   TRUE
);
...
}

So the only way to get a boolean in this scenario is: The DB-query returned an error instead of items.
We could provide an is_array check to prevent the error message, but still the reason has to be found somewhere else.

Updated by Jo Hasenau about 1 year ago

  • Status changed from Needs Feedback to Resolved

Fixed in current trunk

Also available in: Atom PDF