17488 Posts in 4473 Topics by 1978 members
|Go to End|
Core Development Team
20 February 2007 at 5:54pm
If you've uploaded some files, then gone back to the 'Files' tab and clicked on one of these files, you'll notice a big, not-so-shiny error message. The fix to that error is below.
Note: This fix will be included in the next version of SilverStripe.
- Change line 327 from this:
$groups = DataObject::get('Group',"CanCMS=1 OR CanCMSAdmin=1");
$groups = DataObject::get('Group',"", "", "INNER JOIN `Permission` ON `Permission`.GroupID = `Group`.ID AND `Permission`.Code IN ('ADMIN', 'CMS_ACCESS_AssetAdmin')");
- Add the following on line 339 (In between the commented out code and the return statement:
if($groupIDList) $filterClause = "`GroupID` IN (" . implode( ',', $groupIDList ) . ")";
else $filterClause = "";
- Replace the first argument to extendedSQL with $filterClause, so from this:
...extendedSQL( "`GroupID` IN (" . implode( ',', $groupIDList ) . ") AND ( `CanCMS`=1 OR `CanCMSAdmin`=1 )",...
We really need some code highlighting/parsing structure for the forums...
22 February 2007 at 4:37pm
Yes, that fixed it. And yes, got the not very attractive SQL message and your other fix fixed that too
Just to clarify for anyone else adding the fix, the last code change refers to line 341 and the new version should look like:
return new SQLMap( singleton('Member')->extendedSQL( $filterClause, "Surname, FirstName", "", "INNER JOIN `Group_Members` ON `MemberID`=`Member`.`ID` INNER JOIN `Group` ON `Group`.`ID`=`GroupID`") );
Really happy with the way things are going on this CMS, keep up the good work.
|Go to Top|