kirsty
Member
I've got some code in my addon that extends
I'm trying to do the same thing in the
if I uncomment the first line then a reply will send the "add reply error 1", but if I use this code with the commented out first line I get the original error message that the reply triggered and not my "add reply error 2" one. I can't see why that happens? I only get the "add reply error 2" message if there wasn't any other error in the post.
Alternatively, is there a way I can send a view back directly from where I notice the problem with the post content in
Thanks for your help!
Pub/Controller/Forum
and intercepts the reply from actionPostThread
to change a certain error reply (which I create in setupThreadCreate
) into a view where the error can be corrected by the user. That all works fine.I'm trying to do the same thing in the
Pub/Controller/Thread
to intercept the reply (created in setupThreadReply
) in a similar way and I can't see why this isn't working. If I put the following in as my actionAddReply
extension...
Code:
public function actionAddReply(ParameterBag $params)
{
//return $this->error("add reply error 1");
$view = parent::actionAddReply($params);
return $this->error("add reply error 2");
}
if I uncomment the first line then a reply will send the "add reply error 1", but if I use this code with the commented out first line I get the original error message that the reply triggered and not my "add reply error 2" one. I can't see why that happens? I only get the "add reply error 2" message if there wasn't any other error in the post.
Alternatively, is there a way I can send a view back directly from where I notice the problem with the post content in
setupThreadCreate
and setupThreadReply
rather than creating an error that I then intercept later in the thread/post posting process?Thanks for your help!