Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Fixed: Bug in Files & Images section when attempting to view a single file's details


Go to End


2 Posts   2728 Views

Avatar
Matt

Community Member, 86 Posts

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.

In sapphire/security/Member.php:
- Change line 327 from this:
$groups = DataObject::get('Group',"CanCMS=1 OR CanCMSAdmin=1");
To this:
$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 )",...
To this:
...extendedSQL($filterClause,...

We really need some code highlighting/parsing structure for the forums...

Avatar
Peter

Community Member, 4 Posts

22 February 2007 at 4:37pm

Thanks Matt,

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.

Cheers,

Peter