Solved
frode-meling

Jan 24th, 2019 01:09 PM

Testing API function, using insomnia I get this error when edit a post:

ErrorException (E_WARNING) json_decode() expects parameter 1 to be string, object given

Ideas?

frode-meling

Jan 25th, 2019 08:08 AM

I have found out that in my installation of Wave.

tcg/voyager v1.1.10

laravel/framework v5.6.38

data_rows->details get empty json as value. {}. It seems NULL or blank is for all existing data. Is this new in Voyager?

At least it makes Wave crash in ApiController:L238 - $options = json_decode($row->details); it seems $row->details then returns an object of stdClass and not a string, causing json_decode to crash. Also putting valid jsoncode will make this crash. Is it Eloquent that is changed? It seems to not return string, but objects instead.

frode-meling

Jan 25th, 2019 08:19 AM

It seems this pull: https://github.com/the-control-group/voyager/pull/3637 breaks Wave. You should get Wave up with automatic testing before releasing it.

Json_decode can probably be removed from ApiController.

frode-meling

Jan 31st, 2019 12:06 PM

Best Answer

Just remove json_decode from ApiController.php. it fixes the problem