Forums

Getting error in from in this class "JUserWrapperHelper"

priteshcool 27 Aug, 2015
Catchable fatal error: Object of class JUserWrapperHelper could not be converted to string in /administrator/components/com_chronoforms/form_actions/handle_arrays/handle_arrays.php on line 44

I am getting this issue on all of my sites so please help me this because now i need to resolve this error on over 20 sites.
Thanks.
GreyHead 27 Aug, 2015
Hi priteschool,

I've not seen this before so I suspect it is something about the way your forms are set up. Are you adding the Joomla! User Object to the form data?

As a workaround you could hack the action code around line 40 of /administrator/components/com_chronoforms/form_actions/handle_arrays/handle_arrays.php
	function array_handler($data = array(), $skipped = array(), $del = ","){
		foreach($data as $name => $value){
                        // add these three lines
                        if (is_object($value) ) {
                          continue;
                        }
                        // end of hack
			if(is_array($value) && !in_array($name, $skipped)){
				$value = $this->array_handler($value, $skipped, $del);
				$data[$name] = implode($del, $value);
			}
		}
		return $data;
	}

Bob
priteshcool 27 Aug, 2015
Thanks for your reply.
Yes i have created a Registration form and When that form submits then user is creating.
priteshcool 27 Aug, 2015
Still getting the same error.

My code :
function array_handler($data = array(), $skipped = array(), $del = ","){
		foreach($data as $name => $value){
			
			if (is_object($value) ) {
                          continue;
                        }
			
			if(is_array($value) && !in_array($name, $skipped)){
				$value = $this->array_handler($value, $skipped, $del);
				$data[$name] = implode($del, $value);
			}
		}
		return $data;
	}



Actually $value is an Object it is not null.
Now what i have to do ?
Please guide.
GreyHead 27 Aug, 2015
Hi priteschool,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Bob
priteshcool 27 Aug, 2015
After placing debugger not getting any code except this

( ! ) Catchable fatal error: Object of class JUserWrapperHelper could not be converted to string in /administrator/components/com_chronoforms/form_actions/handle_arrays/handle_arrays.php on line 44


http://prntscr.com/89fq4w

See this screenshot
GreyHead 27 Aug, 2015
Hi priteschool,

That looks like output from the Joomla! Debugger, not the ChronoForms one do you see anything useful if you turn Joomla! debug off? I'm trying to work out why you would have an object in the form data.

The DS error at the top suggests that you may have an old version of CFv4 installed - I don't think that would affect the Object problem though.

Bob
priteshcool 27 Aug, 2015
After putting Debugger in submit event that's what i get in screenshot and i am not getting any extra error after enabling Chronoform Debugger.
Yes DS Notice is coming but i think it should not cause any error .
Thanks.
priteshcool 27 Aug, 2015
Hello Dear,
Do you find anything that helps me ?
Please give me solution it is urgent.
Registration form in all sites are not working.
Thanks.
GreyHead 01 Sep, 2015
Hi priteschool,

If you look at the Debugger output from the Joomla! Registration action you will see that there are some Objects included in the data (there's an example in this post). When the Handle Arrays action tries to convert this to a string you will get this error.

But I cannot imagine that you want to convert this array so I suggest that you move the Handle Arrays action up before the Joomla! Registration action; or add _PLUGINS_ to the Skipped Fields box.

Bob
This topic is locked and no more replies can be posted.