xiaohutai / jsonapi

[Bolt Extension] JSON API for Bolt CMS
https://market.bolt.cm/view/bolt/jsonapi
MIT License
55 stars 18 forks source link

Uncaught Exception: ContextErrorException . #83

Closed rainpoiss closed 6 years ago

rainpoiss commented 6 years ago

When using fields[{ct}] i get following error:


ContextErrorException in Parser.php line 42: 
Warning: array_search() expects parameter 2 to be array, string given

            //$fields = array_keys($item->_fields);
        }

        // Both 'id' and 'type' are always required. So remove them from $fields.
        // The remaining $fields go into 'attributes'.
        if (($key = array_search('id', $fields)) !== false) {
            unset($fields[$key]);
        }

        $id = $item->getId();
        $values = [
xiaohutai commented 6 years ago

@rainpoiss Thanks for reporting and sorry for the late fix. It was dead simple now that I looked closeer at it.