{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/f3fff2723db13ec339e1ecf725899307?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f3fff2723db13ec339e1ecf725899307","url":"https://api.github.com/users/tomasm-","login":"tomasm-","id":768459},"milestone":null,"labels":[],"assignee":null,"updated_at":"2011-11-12T20:04:29Z","closed_at":null,"comments":2,"url":"https://api.github.com/repos/CakeDC/comments/issues/26","body":"The CommentWidget is supposed to be able to load elements from /views/elements/comments/flat/main.ctp etc, but since the helper is in a plugin itself, the view paths for the elements puts the current plugin ('comments') before the main elements in /views/elements . comment_widget.php needs to set $params['plugin'] = null, prior to the first $View->element() call.\r\n\r\nAlso, the form.ctp, even when it uses ajax, will open a new window with the results, since the 'target' attribute is set on the form. It should be:\r\n\r\nif($target) {\r\n   ...\r\n  echo $this->Form->create($modelName, array('url' => $ajaxUrl));\r\n} else {\r\n","html_url":"https://github.com/CakeDC/comments/issues/26","title":"CommentWidget never loads custom elements, ajax form posts in new window","number":26,"id":2218387,"created_at":"2011-11-12T19:36:13Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/f3fff2723db13ec339e1ecf725899307?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f3fff2723db13ec339e1ecf725899307","url":"https://api.github.com/users/tomasm-","login":"tomasm-","id":768459},"updated_at":"2011-11-12T20:04:29Z","url":"https://api.github.com/repos/CakeDC/comments/issues/comments/2719128","body":"The form submit button in flat/form.ctp etc should also include 'update'=>$target, otherwise it will function just like a normal submit to a page refresh.\r\n\r\necho $js->submit(__d('comments', 'Submit', true), array_merge(array('url' => $ajaxUrl), $commentWidget->globalParams['ajaxOptions'],array('update'=>$target)));\r\n","id":2719128,"created_at":"2011-11-12T20:04:29Z"}}