Using PHP 5.2 a bug in filemanager.module's function filemanager_get_area_info() will be triggered: The sizelimit of the current area will be determined by calling the API function variable_get() with the string "filemanager_area_limit_" . $area as parameter. Alas the $area variable at this point is set to the resulting object of the former database query and does not longer contain the area name (usually the name of the calling module like acidfree). Actually this never worked because up to PHP 5.1 the $area object when used as string just contained the string "Object" (a PHP fallback). So sizelimit was every time looked up for ''filemanager_area_limit_Object'' but never found and set to the default: -1.

Since PHP 5.2 this fallback does not exist and PHP will just throw the error ''Object of class stdClass could not be converted to string'' (see

The attached patch will fix this.

filemanager_for_php52.patch589 bytesfuerst


drewish’s picture

Status: Active » Fixed

man, that's got to be the best bug report i've read in a while. easy to understand, identifies the problem and includes a patch.

thanks! this has been applied to HEAD and 4.7.

fuerst’s picture

You are welcome :)
I enjoy using the ease of Drupal and its modules. Moreover the way the Drupal community works is a big pleasure too!

Anonymous’s picture

Status: Fixed » Closed (fixed)
cjxxi’s picture

How do I appy the patch? I am having this problem.. And ended here, but I don't know how to apply the patch. any help will be highly appreciated. thanks.

I am not using Drupal or anything, just came up with the problem today

javasac’s picture

I am adding a record and get the "Object of class UserInbox could not be converted to string"
Please help.


// this class fetches the private messages from the t_inbox table 
class UserInbox extends Zend_Db_Table 
	protected $_name = 't_inbox';

	// get all the messages in the zone	
	public function getPrivateMessages($receiverId) 
		//TODO query
		$db = $this->getAdapter();
		$logger = Zend_Registry::get(YoConstants::REGKEY_LOGGER);
		$sql = 'select * from t_inbox i where i.receiver_id = '.$receiverId;
		return $db->fetchAll($sql);		
	// add private messages for the receiver 
	public function postPrivateMessage($senderId, $receiverId, $zoneId, $sub, $msg, $msgType) 
		$logger = Zend_Registry::get(YoConstants::REGKEY_LOGGER);
		$logger->debug('SUBJECT IS ' . $sub);
		$date = Zend_Date::now();
		$data = array(
						'sender_id' => $senderId,
						'receiver_id' => $receiverId,
						'zone_id' => $zoneId,
						'msgDate' => $date->toString,
						'message_type' => $msgType,						
						'message_text' => $msg,
						'subject' => $sub,						
						'msg_read' => 'no',
						'status' => '0'

		$table = new UserInbox();
		$logger->debug('DATE IS ' . $date);
		$logger->debug('DATE IS ' . $date);