huh, sure enough :) I never came across that issue before but casting
definitely did the trick. Thanks for the help!


On Fri, Sep 27, 2013 at 12:22 PM, euromark <[email protected]> wrote:

> User setter/getter combinational methods is pretty dangerous IMO :)
> Especially with a typo-unsafe language as PHP and multiple return types.
> I never use CakeEmail that way - for that very same reason.
>
> to() - as other methods - can return an array when you submit null as
> email.
> My guess: $user['User']['email'] is NULL here, thus the array which you
> can't use as object anymore
>
> You need to cast your fields when doing it this way:
>
>     ->to((string)$user['User']['email'])
>
>
>
> Am Freitag, 27. September 2013 16:15:50 UTC+2 schrieb CrotchFrog:
>
>> Cake 2.41
>>
>> http://bin.cakephp.org/saved/**108632<http://bin.cakephp.org/saved/108632>
>>
>> I'm running into problems trying to send email from plugin.
>>
>> When debug is set to 'Zero' it triggers error : "Error: An internal error
>> has occurred."
>>
>> When debug set to '2' it throws error: "Error: Call to a member function
>> subject() on a non-object."
>>
>> Not too sure what is going on here. Any help is appreciated :)
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/Sa531dnBaLo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to