daylightstudio / FUEL-CMS-Blog-Module

A blog module for FUEL CMS
19 stars 18 forks source link

An Error Was Encountered When adding a new comment Unable to locate the file: users_model.php #3

Closed Dinchar closed 11 years ago

Dinchar commented 11 years ago

An Error Was Encountered Unable to locate the file: users_model.php

Appears when adding a new comment to a post.

Reason: In "./fuel/modules/blog/controllers/blog.php" lines 270 and 272 try to load the non-existing "users_model.php" rather than the exisitng "blog_users_model.php"

Fix: Change line 270 to $this->load->module_model(BLOG_FOLDER, 'blog_users_model');

Change line 272 to $user = $this->blog_users_model->find_one(array('fuel_users.email' => $this->input->post('author_email', TRUE)));

daylightstudio commented 11 years ago

Thanks for the report. A fix has been pushed.

Dinchar commented 11 years ago

Hi,

Sorry for not highlighting it better but there were two changes needed on line 272. The second one, which is not yet fixed is to add fuel_users. before email as now we will end up with a database error.

So line 272 should read: $user = $this->blog_users_model->find_one(array('fuel_users.email' => $this->input->post('author_email', TRUE))); instead of $user = $this->blog_users_model->find_one(array('email' => $this->input->post('author_email', TRUE)));

daylightstudio commented 11 years ago

Good catch. That's been updated.