Permalink
Browse files

fix #308

  • Loading branch information...
1 parent 147456a commit 2f3a78a993baaff8648e33bb8d0b812e49e9d46a @yandod committed Jan 3, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/Controller/WatchersController.php
@@ -33,12 +33,13 @@ public function add()
$this->RequestHandler->isPost() &&
!empty($this->request->data['Watcher']['user_id'])
) {
- $Model = & ClassRegistry::init($this->request->params['named']['object_type']);
+ $Model = & ClassRegistry::init(ucfirst($this->request->params['named']['object_type']));
if(
$Model->read(null, $this->request->params['named']['object_id']) &&
$this->Watcher->User->read(null, $this->request->data['Watcher']['user_id'])
) {
$Model->add_watcher($this->Watcher->User->data);
+ $this->redirect(env('HTTP_REFERER'));
}
}
//Configure::write('debug', 0);

0 comments on commit 2f3a78a

Please sign in to comment.