[Vtigercrm-developers] [PATH] fix missing __toString() methods

Prasad prasad at vtiger.com
Wed Sep 26 06:37:56 PDT 2007


Hi Enrico,

I have a small concern to share with the fix you have mentioned:

this patch fixes some missing __toString() methods which cause
vt to crash when certain objects are accessed as strings.

PHP 5.2 requires __toString() method if an object should be contactenated with string,
this was not the constraint with PHP 5.1 

We use string contacts in debug statements, so adding __toString() to return
a constant value from a object might not be a good way.

Our patch for PHP 5.2 (vtiger 5.0.3) handles this problem by adding get_class($object) in the
string concatenation, this way we don't change the class definition entirely.

get_class($object) returns string which can be concatenated without problem.

Some places we have replaced $user object with $user->user_name instead of
get_class($user) because having user_name information is more useful.

We have integrated such fix in our latest developement branch of vtiger 5.0.4.

Hope this information was useful.

Regards,
Prasad
vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20070926/d339f42a/attachment-0003.html 


More information about the vtigercrm-developers mailing list