mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Fixed PageComment boolean operators in WHERE SQL clauses that break MSSQL (from r91444)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92468 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
61eb69f73b
commit
7f65395331
@ -59,10 +59,10 @@ class CommentAdmin extends LeftAndMain {
|
||||
$filter = "\"IsSpam\" = 0 AND \"NeedsModeration\" = 0";
|
||||
$title = "<h2>". _t('CommentAdmin.APPROVEDCOMMENTS', 'Approved Comments')."</h2>";
|
||||
} else if($section == 'unmoderated') {
|
||||
$filter = '"NeedsModeration"';
|
||||
$filter = '"NeedsModeration" = 1';
|
||||
$title = "<h2>"._t('CommentAdmin.COMMENTSAWAITINGMODERATION', 'Comments Awaiting Moderation')."</h2>";
|
||||
} else {
|
||||
$filter = '"IsSpam"';
|
||||
$filter = '"IsSpam" = 1';
|
||||
$title = "<h2>"._t('CommentAdmin.SPAM', 'Spam')."</h2>";
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ JS;
|
||||
|
||||
function deleteall() {
|
||||
$numComments = 0;
|
||||
$spam = DataObject::get('PageComment', '"PageComment"."IsSpam"');
|
||||
$spam = DataObject::get('PageComment', '"PageComment"."IsSpam" = 1');
|
||||
|
||||
if($spam) {
|
||||
$numComments = $spam->Count();
|
||||
|
@ -166,7 +166,7 @@ class PageComment extends DataObject {
|
||||
class PageComment_Controller extends Controller {
|
||||
function rss() {
|
||||
$parentcheck = isset($_REQUEST['pageid']) ? "\"ParentID\" = " . (int) $_REQUEST['pageid'] : "\"ParentID\" > 0";
|
||||
$unmoderatedfilter = Permission::check('ADMIN') ? '' : "AND NOT \"NeedsModeration\"";
|
||||
$unmoderatedfilter = Permission::check('ADMIN') ? '' : "AND \"NeedsModeration\" = 0";
|
||||
$comments = DataObject::get("PageComment", "$parentcheck AND \"IsSpam\" = 0 $unmoderatedfilter", "\"Created\" DESC", "", 10);
|
||||
if(!isset($comments)) {
|
||||
$comments = new DataObjectSet();
|
||||
|
Loading…
Reference in New Issue
Block a user