[TYPO3-dev] Warnings in error log

Tapio Markula tapio.markula at atwebteam.com
Wed Apr 25 10:32:45 CEST 2007


John Angel kirjoitti:
> Hi,
> 
> I've noticed a bunch of the following warnings in error log. Any ideas 
> what might be the cause?
> 
> 
> PHP Warning:  reset() [<a href='function.reset'>function.reset</a>]: Passed
> variable is not an array or object in
> /typo3/sysext/cms/tslib/class.tslib_fe.php on line 3753
> 
> PHP Warning:  Variable passed to each() is not an array or object in
> /typo3/sysext/cms/tslib/class.tslib_fe.php on line 3754

In general these can ignored.
The most likely reason for them is invalid ext_emconf.php
where constaints => 'array()' - should be array, not string.
In general these means that when normally you get an array,
but if you don't get it, PHP 5 makes a warning message.

This is totally harmless, because the result is most likely ok. 
Presumably some plugin developer
has create configuration related code, which doesn't check, if the 
variable should be an array or not.
I have made this too. PHP 4 doesn't create the warning message
and IMO this warning is not needed because empty variable doesn't
cause processing problem. IMO PHP interpreter should handle
empty variable as empty without unnecessary warning message.

Example

$typesForDisabledTabs = 
t3lib_div::trimExplode(',',strtolower($this->modSharedTSconfig['properties']['disabledTabs']),1);

If this configuration doesn't exist and you make
	$this->disabledTabs = array_flip($typesDisabledTabs);	
PHP 5 creates a warning message.
In order to avoid that, should test, if  array '$typesDisabledTabs' 
exist or not.

class.tslib_fe.php handles frontend plugins - so some plugin doesn't 
test properly arrays.




More information about the TYPO3-dev mailing list