philsturgeon / ee2-rest

Integrate RESTful API's into your ExpressionEngine 2.0 website with this Rest module.
http://devot-ee.com/add-ons/rest
34 stars 13 forks source link

Error in _force_array() function #13

Open arvinsim opened 10 years ago

arvinsim commented 10 years ago

In a few of my pages, I am getting this error when I enable debug mode:

A PHP Error was encountered
Severity: Warning
Message: strtotime() expects parameter 1 to be string, array given
Filename: rest/pi.rest.php
Line Number: 351

The relevant part of the code in pi.rest.php is this:

// Format dates to unix timestamps
elseif (isset($this->EE->TMPL->date_vars[$index]) and ! is_numeric($child))
{
    $child = strtotime($child);
}

I've tried outputting the value of $child before the strtotime call, and I see:

array(1) { ["profile_name"]=> string(18) "John Doe" }

The output is the array representation of the JSON string I expect to be returned to me.

Any ideas what be causing my issues? I am using EE 2.8.1