tyteen4a03 Well-known member May 22, 2013 #1 I want to do something to $visitor->_user in visitor_setup, however, I'm getting Indirect modification of overloaded property has no effect errors. How do I properly do this?
I want to do something to $visitor->_user in visitor_setup, however, I'm getting Indirect modification of overloaded property has no effect errors. How do I properly do this?
tyteen4a03 Well-known member May 22, 2013 #3 sadikb said: You should post your full visitor_setup code. Click to expand... To reproduce the error just do anything to the $visitor object. If you're asking for the actual function it should do, I have none - I’m just asking if this is possible.
sadikb said: You should post your full visitor_setup code. Click to expand... To reproduce the error just do anything to the $visitor object. If you're asking for the actual function it should do, I have none - I’m just asking if this is possible.
xf_phantom Well-known member May 22, 2013 #4 it's working for me PHP: public static function injectIgnoredUsers(XenForo_Visitor &$visitor){ $visitor['my_new_foo'] = 'we\'re here'; $visitor['ignoredUsers'] = self::getIgnoredUsers(); }
it's working for me PHP: public static function injectIgnoredUsers(XenForo_Visitor &$visitor){ $visitor['my_new_foo'] = 'we\'re here'; $visitor['ignoredUsers'] = self::getIgnoredUsers(); }
tyteen4a03 Well-known member May 22, 2013 #5 xf_phantom said: it's working for me PHP: public static function injectIgnoredUsers(XenForo_Visitor &$visitor){ $visitor['my_new_foo'] = 'we\'re here'; $visitor['ignoredUsers'] = self::getIgnoredUsers(); } Click to expand... Oh! I was modifying $visitor->_user. My bad
xf_phantom said: it's working for me PHP: public static function injectIgnoredUsers(XenForo_Visitor &$visitor){ $visitor['my_new_foo'] = 'we\'re here'; $visitor['ignoredUsers'] = self::getIgnoredUsers(); } Click to expand... Oh! I was modifying $visitor->_user. My bad
xf_phantom Well-known member May 22, 2013 #6 $visitor->_user won't work because $_user is protected $visitor->offsetSet('name', 'value'); should work too
$visitor->_user won't work because $_user is protected $visitor->offsetSet('name', 'value'); should work too