zacoppotamus / ElgarsCodingOrchestra

2nd Year Software Engineering Project
project.spe.sneeza.me
3 stars 0 forks source link

Creating a dataset returns an error #77

Closed BenElgar closed 10 years ago

BenElgar commented 10 years ago

Upon sending a create request to the API I get the following response:

<br />
<b>Fatal error</b>:  Call to a member function ensureIndex() on a non-object in <b>/var/www/api/includes/classes/rainhawk/dataset.class.php</b> on line <b>278</b><br />

Despite this error the dataset is actually created.

The create request sent was:

POST /datasets HTTP/1.1
Host: sneeza-eco.p.mashape.com
X-Mashape-Authorization: eSQpirMYxjXUs8xIjjaUo72gutwDJ4CP
Cache-Control: no-cache

----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="name"

bentest4
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="description"

placeholder description
----WebKitFormBoundaryE19zNvXGzXaLvS5C
BenElgar commented 10 years ago

I added a method_exists to the offending line and I now get the following:

{
    "meta": {
        "code": 404,
        "version": "\u03b2",
        "runtime": 0.001
    },
    "data": {
        "message": "There was a problem while trying to create your dataset - please try again later."
    }
}

Slightly better than a fatal error I think.

lukezbihlyj commented 10 years ago

I've fixed this - I wasn't re-initiating the dataset class to get a reference to the actual collection.