• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Object of class stdClass could not be converted to string

Bauer

Well-Known Member
I'm getting this error quite a bit with the latest github update.

fatal error 'Object of class stdClass could not be converted to string' at /home/public_html/components/com_fabrik/models/element.php 1859:

This is happening because of a few calc elements I have that are being stored as JSON arrays.
e.g. [fb_member_facilities___group_emp] => [{"emp_1":"2"},{"emp_3":"1"},{"emp_7":"2"},{"emp_9":"2"},{"emp_22":"2"},{"emp_32":"2"}]
 
1859 doesn't really make sense for the current github. Can you paste some context from your copy, so I know which line it actually is. Or update and get a new line number.

-- hugh
 
It's really @line 1856
I was scratching my head about how the __toString() 'magic method' is supposed to work and if it should be used here.

Then finally I gave up and just went with this - which fixes it.

// $rollOver = (string)$txt;
$rollOver = is_object($txt) ? "" : (string)$txt;
 
Hmm, yeah, it's because we always do a ...

Code:
$data = FabrikWorker::JSONtoData($data, true);

... in renderListData(), prior to building the tips. Of course, normally we will have already processed JSON data in elements into whatever string representation they use (elements like links, or uploads using crop, etc. which may store JSON but at this point will already have built the rendered string), and at that point in renderListData() the only time it'd be JSON would be repeated data (I think for multi-select joins, or things like multi AJAX uploads, or tags), so we bust it into an array and iterate round each one to build individual renders. But but we aren't in control of calc data.

So yeah ...

https://github.com/Fabrik/fabrik/commit/4ab49aef3bf69702cf2538ab2c3658d88cee197a

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top