mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG FIX: SQL queries fixed for MSSQL
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72983 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b8c803f520
commit
ef5c9a42d5
@ -328,8 +328,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
* @return DataObjectSet Comments on this page.
|
||||
*/
|
||||
public function Comments() {
|
||||
$spamfilter = isset($_GET['showspam']) ? '' : 'AND NOT "IsSpam"';
|
||||
$unmoderatedfilter = Permission::check('ADMIN') ? '' : 'AND NOT "NeedsModeration"';
|
||||
$spamfilter = isset($_GET['showspam']) ? '' : "AND \"IsSpam\"=0";
|
||||
$unmoderatedfilter = Permission::check('ADMIN') ? '' : "AND \"NeedsModeration\"=0";
|
||||
$comments = DataObject::get("PageComment", "\"ParentID\" = '" . Convert::raw2sql($this->ID) . "' $spamfilter $unmoderatedfilter", "\"Created\" DESC");
|
||||
|
||||
return $comments ? $comments : new DataObjectSet();
|
||||
|
Loading…
x
Reference in New Issue
Block a user