craftcms / element-api

Create a JSON API/Feed for your elements in Craft.
MIT License
498 stars 57 forks source link

Breaks with nested arrays in GET #16

Closed timkelty closed 8 years ago

timkelty commented 8 years ago

Since #6, there is now a "Array to string conversion" notice if you try and pass an array in the GET. E.g. ?criteria[section]=foo

It looks like UrlHelper/getUrl/_normalizeParams doesn't play nice with nested arrays.

angrybrad commented 8 years ago

Can you make sure you're on the latest version of Craft, take the attached file, drop it in craft/app/helpers and let me know if it solves your problem and/or creates any unintended side-effects?

UrlHelper.php.zip

timkelty commented 8 years ago

Works like a charm! Hooray for http_build_query!

angrybrad commented 8 years ago

Cool... fix will be in the next Craft release.