Code Monkey home page Code Monkey logo

Comments (7)

wilr avatar wilr commented on July 29, 2024

Are you running the latest master checkout?

from silverstripe-comments.

reececropley avatar reececropley commented on July 29, 2024

No i'm running V1.1 as its a SS 3.0 installation.

Not sure if its related but when I go to mark a comment as spam. I receive this error:

[Notice] Undefined variable: request
GET /site/CommentingController/spam/17?SecurityID=f94b6e96687a8cb2a820d6f61ac717af7a0b4868
Line 136 in /home/ccremove/public_html/site/comments/code/controllers/CommentingController.php

relating to this peice of code:

public function spam() {
136         if(!$this->checkSecurityToken($request)) {
137             return $this->httpError(400);
138         }

from silverstripe-comments.

reececropley avatar reececropley commented on July 29, 2024

Is there any updates on this at all? Perhaps I have something set wrong?

from silverstripe-comments.

reececropley avatar reececropley commented on July 29, 2024

Not sure whether anyone has had a look into this, perhaps I wasn't understanding how moderation works.

I have 'require_moderation' set to true in /mysite/_config.php

Commenting::add('Foo', array(
    'require_moderation' => true
));

However when I add a comment it is still displaying in the Moderated tab in the backend. Editing the comment through the backend I can see the the 'Moderated?' checkbox is checked. I assume this shouldn't be the case.

I'm not sure what the 'Foo' section means. I understand that this is the name of the array (at least I hope im right here). Do I need to use this 'Foo' name elsewhere in my code. There doesn't seem to be much documentation on this.

from silverstripe-comments.

reececropley avatar reececropley commented on July 29, 2024

After a bit more digging in I realised I needed to do the following into the /mysite/_config.php

  Commenting::set_config_value('SiteTree', 'require_moderation',true);

No in the backend of the site new comments are not moderated. The issue I have now is that they still show up on the website. I presume its this code in the CommentingController.php that assigns whether to display it or not, but its doesn't seem to affect it

   if(!$comment->Moderated) {
                echo $comment->renderWith('CommentInterface_pendingcomment');
            } else {
                echo $comment->renderWith('CommentInterface_singlecomment');
            }

from silverstripe-comments.

jellygnite avatar jellygnite commented on July 29, 2024

I amended the CommentsInterface.ss template to check for moderation. Works for me.

                <% loop Comments %>
                    <% if Moderated %>
                    <li class="comment $EvenOdd<% if FirstLast %> $FirstLast <% end_if %> $SpamClass">
                        <% include CommentsInterface_singlecomment %>
                    </li>
                    <% end_if %>
                <% end_loop %>

from silverstripe-comments.

wilr avatar wilr commented on July 29, 2024

Request var has been fixed, Comments are filtered by Moderated status and test added for that behaviour (5a8de05).

from silverstripe-comments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.