Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Use updated Versioned and Staged classes #653

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AssetControlExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\Security\Member;
use SilverStripe\Core\Extension;

Expand Down
4 changes: 2 additions & 2 deletions src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
use SilverStripe\Security\PermissionChecker;
use SilverStripe\Security\PermissionProvider;
use SilverStripe\Security\Security;
use SilverStripe\Versioned\RecursivePublishable;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Staged\RecursivePublishable;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\View\HTML;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/FilenameParsing/FileIDHelperResolutionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\Assets\File;
use SilverStripe\ORM\DB;

Expand Down
2 changes: 1 addition & 1 deletion src/Flysystem/FlysystemAssetStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use SilverStripe\Core\Flushable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Security\Security;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* Asset store based on flysystem Filesystem as a backend
Expand Down
4 changes: 2 additions & 2 deletions src/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject;
use SilverStripe\Core\Validation\ValidationResult;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* Represents a logical folder, which may be used to organise assets
Expand Down Expand Up @@ -76,7 +76,7 @@ public static function find_or_make($folderPath)
// When in archived mode, find or make should not find folders that don't exist
// We check explicitly for Versioned and if it exists then we'll confirm the reading mode isn't archived
if (class_exists(Versioned::class)) {
$versioned = Injector::inst()->get('SilverStripe\Versioned\Versioned');
$versioned = Injector::inst()->get('SilverStripe\Versioned\Mode\Versioned');
if ($versioned
&& strpos($versioned::get_reading_mode() ?? '', 'Archive.') !== false) {
// We return the searched for folder, it will either be null if it doesn't exist
Expand Down
2 changes: 1 addition & 1 deletion src/Shortcodes/FileLinkTracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\ManyManyThroughList;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\View\Parsers\HTMLValue;
use SilverStripe\Core\Extension;

Expand Down
2 changes: 1 addition & 1 deletion tests/php/AssetControlExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use SilverStripe\Assets\Tests\AssetControlExtensionTest\VersionedObject;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* Tests {@see AssetControlExtension}
Expand Down
2 changes: 1 addition & 1 deletion tests/php/AssetControlExtensionTest/TestObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Member;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* A basic unversioned object
Expand Down
2 changes: 1 addition & 1 deletion tests/php/AssetControlExtensionTest/VersionedObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Security;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\Security\Member;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/php/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\Security\Member;
use SilverStripe\Security\PermissionChecker;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use PHPUnit\Framework\Attributes\DataProvider;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use SilverStripe\Assets\Storage\Sha1FileHashingService;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use PHPUnit\Framework\Attributes\DataProvider;

class FileIDHelperResolutionStrategyTest extends SapphireTest
Expand Down
2 changes: 1 addition & 1 deletion tests/php/FolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\Security\InheritedPermissions;
use SilverStripe\Security\Member;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* @author Ingo Schommer (ingo at silverstripe dot com)
Expand Down
2 changes: 1 addition & 1 deletion tests/php/ProtectedFileControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use PHPUnit\Framework\Attributes\DataProvider;

class ProtectedFileControllerTest extends FunctionalTest
Expand Down
2 changes: 1 addition & 1 deletion tests/php/RedirectFileControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Assets\Dev\TestAssetStore;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use PHPUnit\Framework\Attributes\DataProvider;

class RedirectFileControllerTest extends FunctionalTest
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Shortcodes/FileBrokenLinksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use SilverStripe\Assets\File;
use SilverStripe\Assets\Tests\Shortcodes\FileBrokenLinksTest\EditableObject;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* Tests broken links in html areas
Expand Down
4 changes: 2 additions & 2 deletions tests/php/Shortcodes/FileBrokenLinksTest/EditableObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use SilverStripe\Assets\Shortcodes\FileLinkTracking;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\RecursivePublishable;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Staged\RecursivePublishable;
use SilverStripe\Versioned\Mode\Versioned;

/**
* @mixin RecursivePublishable
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Shortcodes/FileLinkTrackingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use SilverStripe\Assets\Tests\Shortcodes\FileBrokenLinksTest\EditableObject;
use SilverStripe\Core\Convert;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

class FileLinkTrackingTest extends SapphireTest
{
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Shortcodes/FileShortcodeProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use SilverStripe\Dev\SapphireTest;
use SilverStripe\ErrorPage\ErrorPage;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\View\Parsers\ShortcodeParser;

class FileShortcodeProviderTest extends SapphireTest
Expand Down
2 changes: 1 addition & 1 deletion tests/php/UploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Security\Member;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

class UploadTest extends SapphireTest
{
Expand Down
Loading