I'm having difficulty getting the delete function to work when using Umbraco 7.3.8. and I'm hoping you can help :-)
As far as I can tell, the Forum.js file should identify the delete class on posts, which I presume is happening correctly as the forum.js code is included on the SimpilyForumsPost view. The js then makes reference to an API URL, but the url doesn't exist?
so for example /Umbraco/Api/SimpilyForumsApi/DeletePost/1114 will delete post 1114
The code will only allow authors to delete posts, but then the front end should stop non authors from seeing the delete button. but then it just returns false if that happens (not 404)
If you have chrome dev tools open while you try a delete, you should see the call being made in the network tab . any errors would also show up in the console?
Thanks Kevin. All resolved now, because I decided to remove the simpily forums container doc type and just have one for forum listing and post I needed to amend the doctype in the controller to Master.
Delete Function
Hi Kevin,
I'm having difficulty getting the delete function to work when using Umbraco 7.3.8. and I'm hoping you can help :-)
As far as I can tell, the Forum.js file should identify the delete class on posts, which I presume is happening correctly as the forum.js code is included on the SimpilyForumsPost view. The js then makes reference to an API URL, but the url doesn't exist?
https://github.com/Jumoo/Jumoo.Simpily/blob/master/Simpily.Site/Scripts/JumooSimpily/Forums.js specifically:
"url: '/Umbraco/Api/SimpilyForumsApi/DeletePost/' + postId"
Should this URL point to SimpiliyForumsApiController that sits in Appcode? (here: https://github.com/Jumoo/Jumoo.Simpily/tree/master/Simpily.Site/AppCode/SimpilyForums/Controllers)? Or does Umbraco create the URL above 'on the fly' ?
Hi
yeah, the URL is part of how Umbraco Routes Controllers within the system.
Umbraco Controllers go to :
/Umbraco/Api/ControllerName(-"Controller")/Action/Id
so for example
/Umbraco/Api/SimpilyForumsApi/DeletePost/1114
will delete post 1114The code will only allow authors to delete posts, but then the front end should stop non authors from seeing the delete button. but then it just returns false if that happens (not 404)
If you have chrome dev tools open while you try a delete, you should see the call being made in the network tab . any errors would also show up in the console?
Oh dear. Brain fail. It looks like i wasn't including the Tiny MCE script, which was stopping the forum.js from processing and thus... no delete.
A final question Kevin if I may.
Is it possible for forum posts to automatically be published and automatically allow for replies ?
Many thanks for all your help by the way !
Hi yeah,
posts should auto publish. and replies shoud set when it publishes,
just check the doctype aliases are right in the code https://github.com/Jumoo/Jumoo.Simpily/blob/master/Simpily.Site/App_Code/SimpilyForums/Controllers/SimpilyForumsController.cs
they can be case sensitive so if for some reason SimpilyForums has a lower case S or something auto reply won't be set.
Thanks Kevin. All resolved now, because I decided to remove the simpily forums container doc type and just have one for forum listing and post I needed to amend the doctype in the controller to Master.
Many thanks for the assistance, very helpful :-)
is working on a reply...