avatar Gnat Nov 13. 2009. 11:58 am
We're developing some modules, and have used the getTrashUrl() but it fails with a bad request. I've traced it down to ProjectObjectsController::executeOnActiveObject(). It fails because on line 699, $this->request->isSubmitted() is false. I can't see how it would *ever* be a post submitted request. Even the tasks move to trash links are simple href's, so I don't know how theirs pass that test. It isn't over ridden in any controller. I can't find any kind of javascript listeners on the link either.

How come this isn't working?
avatar Oliver Maksimović Staff Nov 13. 2009. 9:07 pm
Use "link" helper for creating links in templates and add 'post' as method parameter:

{link href=your_url method=post confirm='are you sure'}delete me{/link}

activecollab will take care of the rest, and the action will be just like it was a submitted form (meaning that $this->request->isSubmitted() will then evaluate to 'true').

Link helper's definition is at /activecollab/angie/classes/smarty/plugins/block.link.php
activeCollab tech support / development