Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Help installing comments module

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 785 Views
  • nw
    Avatar
    Community Member
    3 Posts

    Help installing comments module Link to this post

    I'm trying to get comments working on a site (using SS3.0.1), but seem to be running into some problems.
    I've tried using the comments module from here and from Github (just to make sure I wasn't using an outdated version), and both seem to work, provided that I am not logged in (as admin). As soon as I am logged in and try to access a page with a comments area, an error appears:

    [User Error] Couldn't run query: SELECT COUNT(*) FROM "PageComment" WHERE "NeedsModeration"=1 Table 'SS3_plural.PageComment' doesn't exist
    GET /SS3.0.1/blog/sample-blog-entry/
    Line 568 in /var/www/SS3.0.1/framework/model/MySQLDatabase.php

    I've re-built the installation (/dev/build), which doesn't seem to fix it. Looking at the MySQL database, there does not appear to be any table called 'PageComment', so that seems to be part of the issue, but I'm still not sure how to go about solving the problem. Any help would be appreciated.

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Help installing comments module Link to this post

    Could you please attach the full back trace. PageComment table shouldn't exist (it's part of the old 2.4 code) so make sure if you have any custom code that has been updated as well.

  • nw
    Avatar
    Community Member
    3 Posts

    Re: Help installing comments module Link to this post

    hmm... I went to grab the full output, but everything seems to be working fine now (despite having not changed anything), and I can't seem to recreate the problem. How peculiar. Thanks anyway for the prompt reply Will.

  • Dazman1
    Avatar
    Community Member
    30 Posts

    Re: Help installing comments module Link to this post

    HI
    I seem to have that problem, i keep flushing, re-installing widget but keep getting the error,

    Trace
    Couldn't run query: SELECT COUNT(*) FROM "PageComment" WHERE "NeedsModeration"=1 Table 'lexandcl_batavi.PageComment' doesn't exist
    MySQLDatabase.php:568
    MySQLDatabase->databaseError(Couldn't run query: SELECT COUNT(*) FROM "PageComment" WHERE "NeedsModeration"=1 | Table 'lexandcl_batavi.PageComment' doesn't exist,256)
    MySQLDatabase.php:127
    MySQLDatabase->query(SELECT COUNT(*) FROM "PageComment" WHERE "NeedsModeration"=1,256)
    DB.php:129
    DB::query(SELECT COUNT(*) FROM "PageComment" WHERE "NeedsModeration"=1)
    BlogManagementWidget.php:39
    BlogManagementWidget->CommentLink()
    call_user_func_array(Array,Array)
    Object.php:602
    Object->__call(CommentLink,Array)
    ViewableData.php:366
    BlogManagementWidget_Controller->CommentLink()
    ViewableData.php:366
    ViewableData->obj(CommentLink,,,1,)
    ViewableData.php:408
    ViewableData->cachedCall(CommentLink,)
    ViewableData.php:421
    ViewableData->hasValue(CommentLink,,1)
    call_user_func_array(Array,Array)
    SSViewer.php:128
    SSViewer_Scope->__call(hasValue,Array)
    SSViewer.php:459
    SSViewer_DataPresenter->__call(hasValue,Array)
    .cache.blog.templates.BlogManagementWidget.ss:19
    SSViewer_DataPresenter->hasValue(CommentLink,,1)
    .cache.blog.templates.BlogManagementWidget.ss:19
    include(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.blog.templates.BlogManagementWidget.ss)
    SSViewer.php:778
    SSViewer->includeGeneratedTemplate(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.blog.templates.BlogManagementWidget.ss,BlogManagementWidget_Controller,,Array)
    SSViewer.php:844
    SSViewer->process(BlogManagementWidget_Controller,)
    ViewableData.php:335
    ViewableData->renderWith(Array)
    Widget.php:200
    Widget_Controller->Content()
    ViewableData.php:366
    ViewableData->obj(Content,,,1)
    ViewableData.php:443
    ViewableData->XML_val(Content,,1)
    call_user_func_array(Array,Array)
    SSViewer.php:128
    SSViewer_Scope->__call(XML_val,Array)
    SSViewer.php:459
    SSViewer_DataPresenter->__call(XML_val,Array)
    .cache.widgets.templates.WidgetHolder.ss:25
    SSViewer_DataPresenter->XML_val(Content,,1)
    .cache.widgets.templates.WidgetHolder.ss:25
    include(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.widgets.templates.WidgetHolder.ss)
    SSViewer.php:778
    SSViewer->includeGeneratedTemplate(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.widgets.templates.WidgetHolder.ss,BlogManagementWidget_Controller,,Array)
    SSViewer.php:844
    SSViewer->process(BlogManagementWidget_Controller,)
    ViewableData.php:335
    ViewableData->renderWith(WidgetHolder)
    BlogManagementWidget.php:58
    BlogManagementWidget_Controller->WidgetHolder()
    ViewableData.php:366
    ViewableData->obj(WidgetHolder,,,1)
    ViewableData.php:443
    ViewableData->XML_val(WidgetHolder,,1)
    call_user_func_array(Array,Array)
    SSViewer.php:128
    SSViewer_Scope->__call(XML_val,Array)
    SSViewer.php:459
    SSViewer_DataPresenter->__call(XML_val,Array)
    .cache.widgets.templates.WidgetArea.ss:6
    SSViewer_DataPresenter->XML_val(WidgetHolder,,1)
    .cache.widgets.templates.WidgetArea.ss:6
    include(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.widgets.templates.WidgetArea.ss)
    SSViewer.php:778
    SSViewer->includeGeneratedTemplate(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.widgets.templates.WidgetArea.ss,WidgetArea,,Array)
    SSViewer.php:844
    SSViewer->process(WidgetArea,)
    ViewableData.php:335
    ViewableData->renderWith(WidgetArea)
    WidgetArea.php:58
    WidgetArea->forTemplate()
    ViewableData.php:444
    ViewableData->XML_val(SideBar,,1)
    call_user_func_array(Array,Array)
    SSViewer.php:128
    SSViewer_Scope->__call(XML_val,Array)
    SSViewer.php:459
    SSViewer_DataPresenter->__call(XML_val,Array)
    .cache.blog.templates.Includes.BlogSideBar.ss:5
    SSViewer_DataPresenter->XML_val(SideBar,,1)
    .cache.blog.templates.Includes.BlogSideBar.ss:5
    include(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.blog.templates.Includes.BlogSideBar.ss)
    SSViewer.php:778
    SSViewer->includeGeneratedTemplate(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.blog.templates.Includes.BlogSideBar.ss,BlogHolder_Controller,Array,Array)
    SSViewer.php:844
    SSViewer->process(BlogHolder_Controller,Array)
    SSViewer.php:872
    SSViewer::execute_template(BlogSideBar,BlogHolder_Controller,Array)
    .cache.themes.bussagev2.templates.Includes.SideBar.ss:5
    include(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.themes.bussagev2.templates.Includes.SideBar.ss)
    SSViewer.php:778
    SSViewer->includeGeneratedTemplate(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.themes.bussagev2.templates.Includes.SideBar.ss,BlogHolder_Controller,Array,Array)
    SSViewer.php:844
    SSViewer->process(BlogHolder_Controller,Array)
    SSViewer.php:872
    SSViewer::execute_template(SideBar,BlogHolder_Controller,Array)
    .cache.themes.bussagev2.templates.Page.ss:101
    include(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.themes.bussagev2.templates.Page.ss)
    SSViewer.php:778
    SSViewer->includeGeneratedTemplate(/home4/lexandcl/public_html/bussage/new2/silverstripe-cache/.cache.themes.bussagev2.templates.Page.ss,BlogHolder_Controller,,Array)
    SSViewer.php:844
    SSViewer->process(BlogHolder_Controller)
    Controller.php:204
    Controller->handleAction(SS_HTTPRequest)
    RequestHandler.php:168
    RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
    Controller.php:149
    Controller->handleRequest(SS_HTTPRequest,DataModel)
    ContentController.php:197
    ContentController->handleRequest(SS_HTTPRequest,DataModel)
    ModelAsController.php:68
    ModelAsController->handleRequest(SS_HTTPRequest,DataModel)
    Director.php:281
    Director::handleRequest(SS_HTTPRequest,Session,DataModel)
    Director.php:112
    Director::direct(/blog/,DataModel)
    main.php:126

    any ideas?

    Thanks

    Darren

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Help installing comments module Link to this post

    Oh this is related to BlogManagementWidget, have you updated your Blog module installation to the latest master?

  • Dazman1
    Avatar
    Community Member
    30 Posts

    Re: Help installing comments module Link to this post

    HI Will

    Yes i have the latest version of the blog? and the latest version of the comments and widgets installed.

    Thanks

    Darren

  • Dazman1
    Avatar
    Community Member
    30 Posts

    Re: Help installing comments module Link to this post

    Found it
    in BlogManagementWidget.php

    it had Pagecomment instead of just comment

    from line 23 to 34 should read

    function CommentText() {

          if(!class_exists('Comment')) return false;
          $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"Comment\" WHERE \"Moderated\"=1")->value();
          if($unmoderatedcount == 1) {
             return _t("BlogManagementWidget.UNM1", "You have 1 unmoderated comment");
          } else if($unmoderatedcount > 1) {
             return sprintf(_t("BlogManagementWidget.UNMM", "You have %i unmoderated comments"), $unmoderatedcount);
          } else {
             return _t("BlogManagementWidget.COMADM", "Comment administration");
          }
       }

    thanks will

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Help installing comments module Link to this post

    Which is why I suspect you have an old version of blog module as it seems fine in https://github.com/silverstripe/silverstripe-blog/blob/master/code/widgets/BlogManagementWidget.php

    785 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.