The implementation of the method RedBeanPHP\OODBBean::__toString() only works as intended if \R::setErrorHandlingFUSE(\RedBeanPHP\OODBBean::C_ERR_IGNORE); is set.
If a model class doesn't implement the __toString() method, the RedBeanPHP\OODBBean::__call() method will at least cause (possible confusing) spam in in the log files or fail unexpectedly.
And even worse, in case of \RedBeanPHP\OODBBean::C_ERR_EXCEPTION php will fail with
PHP Fatal error: Method RedBeanPHP\OODBBean::__toString() must not throw an exception
and no hint on how to debug that.
I temporarily fixed it in the method RedBeanPHP\OODBBean::__call() by adding the __toString method
to the whitelist:
The implementation of the method
RedBeanPHP\OODBBean::__toString()
only works as intended if\R::setErrorHandlingFUSE(\RedBeanPHP\OODBBean::C_ERR_IGNORE);
is set.If a model class doesn't implement the
__toString()
method, theRedBeanPHP\OODBBean::__call()
method will at least cause (possible confusing) spam in in the log files or fail unexpectedly.And even worse, in case of
\RedBeanPHP\OODBBean::C_ERR_EXCEPTION
php will fail withand no hint on how to debug that.
I temporarily fixed it in the method
RedBeanPHP\OODBBean::__call()
by adding the__toString
method to the whitelist:But I have no idea if that destroys anything else.