Skip to content

Commit

Permalink
Merge branch '3.0' into 3
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 12, 2024
2 parents 98dd61b + 8ae974d commit e539373
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"silverstripe/template-engine": "^1",
"silverstripe/vendor-plugin": "^2",
"symfony/filesystem": "^7.0",
"intervention/image": "^3.7",
"league/flysystem": "^3.22",
"league/flysystem-local": "^3.22"
"intervention/image": "^3.9",
"league/flysystem": "^3.29",
"league/flysystem-local": "^3.29"
},
"require-dev": {
"silverstripe/recipe-testing": "^4",
Expand Down
21 changes: 5 additions & 16 deletions src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use SilverStripe\Security\InheritedPermissionsExtension;
use SilverStripe\Security\Member;
use SilverStripe\Security\Permission;
use SilverStripe\Security\PermissionCheckable;
use SilverStripe\Security\PermissionChecker;
use SilverStripe\Security\PermissionProvider;
use SilverStripe\Security\Security;
Expand Down Expand Up @@ -99,7 +100,7 @@
* @method Member Owner()
* @method File Parent()
*/
class File extends DataObject implements AssetContainer, Thumbnail, CMSPreviewable, PermissionProvider, Resettable
class File extends DataObject implements AssetContainer, Thumbnail, CMSPreviewable, PermissionProvider, Resettable, PermissionCheckable
{
use ImageManipulation;

Expand Down Expand Up @@ -351,14 +352,6 @@ public function AbsoluteLink()
return $this->getAbsoluteURL();
}

/**
* @return string
*/
public function getTreeTitle()
{
return Convert::raw2xml($this->Title);
}

/**
* @param Member $member
* @return bool
Expand Down Expand Up @@ -1435,10 +1428,7 @@ public function PreviewLink($action = null)
return $link;
}

/**
* @return PermissionChecker
*/
public function getPermissionChecker()
public function getPermissionChecker(): PermissionChecker
{
return Injector::inst()->get(PermissionChecker::class.'.file');
}
Expand Down Expand Up @@ -1518,13 +1508,12 @@ protected function filterFilename($name)
}, $parts ?? []));
}

public function flushCache($persistent = true): static
public function flushCache(bool $persistent = true): static
{
parent::flushCache($persistent);
static::reset();
ImageShortcodeProvider::flush();
FileShortcodeProvider::flush();
return $this;
return parent::flushCache($persistent);
}

public static function reset()
Expand Down

0 comments on commit e539373

Please sign in to comment.