Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul 184 posts 646 karma points
    Apr 15, 2016 @ 09:10
    Paul
    0

    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' ?

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 15, 2016 @ 09:34
    Kevin Jump
    100

    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 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?

  • Paul 184 posts 646 karma points
    Apr 15, 2016 @ 10:12
    Paul
    0

    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 !

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 15, 2016 @ 10:47
    Kevin Jump
    1

    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.

  • Paul 184 posts 646 karma points
    Apr 15, 2016 @ 14:16
    Paul
    0

    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 :-)

Please Sign in or register to post replies

Write your reply to:

Draft