diff --git a/src/Cms/DMSDocumentAddController.php b/src/Cms/DMSDocumentAddController.php index 5c61b0f..3a3df3a 100644 --- a/src/Cms/DMSDocumentAddController.php +++ b/src/Cms/DMSDocumentAddController.php @@ -2,24 +2,6 @@ namespace Sunnysideup\DMS\Cms; - - - - - - - - - - - - - - - - - - use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Controllers\CMSMain; use Sunnysideup\DMS\Model\DMSDocumentSet; @@ -41,8 +23,6 @@ use SilverStripe\Security\Member; use SilverStripe\Security\Permission; use SilverStripe\Admin\LeftAndMain; - - /** * @package dms */ @@ -125,14 +105,14 @@ class DMSDocumentAddController extends LeftAndMain */ Requirements::javascript(SilverStripe\Core\Manifest\ModuleLoader::getModule('silverstripe/framework')->getResource('UPGRADE-FIX-REQUIRED.php')->getRelativePath() . '/javascript/AssetUploadField.js'); -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: FRAMEWORK_DIR (ignore case) - * NEW: SilverStripe\Core\Manifest\ModuleLoader::getModule('silverstripe/framework')->getResource('UPGRADE-FIX-REQUIRED.php')->getRelativePath() (COMPLEX) - * EXP: Please review update and fix as required - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: FRAMEWORK_DIR (ignore case) + * NEW: SilverStripe\Core\Manifest\ModuleLoader::getModule('silverstripe/framework')->getResource('UPGRADE-FIX-REQUIRED.php')->getRelativePath() (COMPLEX) + * EXP: Please review update and fix as required + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ Requirements::css(SilverStripe\Core\Manifest\ModuleLoader::getModule('silverstripe/framework')->getResource('UPGRADE-FIX-REQUIRED.php')->getRelativePath() . '/css/AssetUploadField.css'); Requirements::css(DMS_DIR . '/dist/css/cmsbundle.css'); diff --git a/src/Cms/DMSDocumentAddExistingField.php b/src/Cms/DMSDocumentAddExistingField.php index bd54647..69a2f76 100644 --- a/src/Cms/DMSDocumentAddExistingField.php +++ b/src/Cms/DMSDocumentAddExistingField.php @@ -2,9 +2,6 @@ namespace Sunnysideup\DMS\Cms; - - - use SilverStripe\CMS\Model\SiteTree; use SilverStripe\Forms\TreeDropdownField; use SilverStripe\ORM\DataObject; @@ -12,8 +9,6 @@ use SilverStripe\View\Requirements; use Sunnysideup\DMS\Cms\DMSDocumentAddExistingField; use SilverStripe\Forms\CompositeField; - - class DMSDocumentAddExistingField extends CompositeField { public $useFieldContext = true; diff --git a/src/Cms/DMSDocumentAdmin.php b/src/Cms/DMSDocumentAdmin.php index ff9fa54..9b6d332 100644 --- a/src/Cms/DMSDocumentAdmin.php +++ b/src/Cms/DMSDocumentAdmin.php @@ -2,8 +2,6 @@ namespace Sunnysideup\DMS\Cms; - - use CMSForm; @@ -19,8 +17,6 @@ use SilverStripe\Forms\GridField\GridFieldDataColumns; use SilverStripe\CMS\Model\SiteTree; use SilverStripe\Admin\ModelAdmin; - - class DMSDocumentAdmin extends ModelAdmin { private static $managed_models = array( diff --git a/src/Cms/DMSGridFieldAddNewButton.php b/src/Cms/DMSGridFieldAddNewButton.php index 8dc730b..9e185b2 100644 --- a/src/Cms/DMSGridFieldAddNewButton.php +++ b/src/Cms/DMSGridFieldAddNewButton.php @@ -2,12 +2,6 @@ namespace Sunnysideup\DMS\Cms; - - - - - - use Sunnysideup\DMS\Cms\DMSDocumentAddController; use SilverStripe\Control\Controller; use Sunnysideup\DMS\Model\DMSDocumentSet; @@ -17,8 +11,6 @@ use Sunnysideup\DMS\Cms\DMSGridFieldAddNewButton; use SilverStripe\Forms\GridField\GridFieldAddNewButton; use SilverStripe\Forms\GridField\GridField_HTMLProvider; - - class DMSGridFieldAddNewButton extends GridFieldAddNewButton implements GridField_HTMLProvider { /** diff --git a/src/Cms/DMSGridFieldDetailForm.php b/src/Cms/DMSGridFieldDetailForm.php index df70a18..23e9a7a 100644 --- a/src/Cms/DMSGridFieldDetailForm.php +++ b/src/Cms/DMSGridFieldDetailForm.php @@ -2,13 +2,9 @@ namespace Sunnysideup\DMS\Cms; - - use Sunnysideup\DMS\Tools\ShortCodeRelationFinder; use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest; - - /** * Custom ItemRequest class the provides custom delete behaviour for the CMSFields of DMSDocument */ diff --git a/src/Cms/DMSGridFieldEditButton.php b/src/Cms/DMSGridFieldEditButton.php index 348c093..64d24aa 100755 --- a/src/Cms/DMSGridFieldEditButton.php +++ b/src/Cms/DMSGridFieldEditButton.php @@ -2,18 +2,12 @@ namespace Sunnysideup\DMS\Cms; - - - - use SilverStripe\Control\Controller; use SilverStripe\View\ArrayData; use SilverStripe\Forms\GridField\GridFieldEditButton; use SilverStripe\Forms\GridField\GridFieldViewButton; use SilverStripe\Forms\GridField\GridField_ColumnProvider; - - class DMSGridFieldEditButton extends GridFieldEditButton implements GridField_ColumnProvider { diff --git a/src/Cms/DMSUploadField.php b/src/Cms/DMSUploadField.php index 91dd65a..c1d8183 100644 --- a/src/Cms/DMSUploadField.php +++ b/src/Cms/DMSUploadField.php @@ -2,11 +2,6 @@ namespace Sunnysideup\DMS\Cms; - - - - - use Exception; @@ -28,8 +23,6 @@ use SilverStripe\Forms\FormAction; use SilverStripe\Forms\Validator; use SilverStripe\AssetAdmin\Forms\UploadField; - - /** * Field for uploading files into a DMSDocument. Replacing the existing file. * Not ideally suited for the purpose, as the base implementation diff --git a/src/Cms/DMSUploadField_ItemHandler.php b/src/Cms/DMSUploadField_ItemHandler.php index 12cb842..8e8b3fb 100644 --- a/src/Cms/DMSUploadField_ItemHandler.php +++ b/src/Cms/DMSUploadField_ItemHandler.php @@ -9,8 +9,6 @@ namespace Sunnysideup\DMS\Cms; use Sunnysideup\DMS\Model\DMSDocument; use SilverStripe\Forms\Form; - - class DMSUploadField_ItemHandler { private static $allowed_actions = array( diff --git a/src/Cms/DocumentHtmlEditorFieldToolbar.php b/src/Cms/DocumentHtmlEditorFieldToolbar.php index 4701a60..75be365 100644 --- a/src/Cms/DocumentHtmlEditorFieldToolbar.php +++ b/src/Cms/DocumentHtmlEditorFieldToolbar.php @@ -2,16 +2,11 @@ namespace Sunnysideup\DMS\Cms; - - - - use SilverStripe\Forms\Form; use Sunnysideup\DMS\DMS; use SilverStripe\Forms\HiddenField; use SilverStripe\Core\Extension; - /** * Extends the original toolbar with document picking capability - modified lines are commented. */ @@ -50,7 +45,7 @@ class DocumentHTMLEditorFieldToolbar extends Extension $fieldList->push(HiddenField::create('DMSShortcodeHandlerKey', false, DMS::inst()->getShortcodeHandlerKey())); -// Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js"); + // Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js"); // Requirements::javascript(SAPPHIRE_DIR . "/javascript/tiny_mce_improvements.js"); // // // create additional field, rebase to 'documents' directory diff --git a/src/DMS.php b/src/DMS.php index b2de351..949cef2 100644 --- a/src/DMS.php +++ b/src/DMS.php @@ -2,7 +2,6 @@ namespace Sunnysideup\DMS; - use SilverStripe\Core\Injector\Injector; @@ -19,7 +18,6 @@ use SilverStripe\Core\Config\Config; use Sunnysideup\DMS\DMS; use Sunnysideup\DMS\Interfaces\DMSInterface; - class DMS extends ViewableData implements DMSInterface { /** diff --git a/src/DMSShortcodeHandler.php b/src/DMSShortcodeHandler.php index 8057d86..1ac7ebf 100644 --- a/src/DMSShortcodeHandler.php +++ b/src/DMSShortcodeHandler.php @@ -2,15 +2,10 @@ namespace Sunnysideup\DMS; - - - use SilverStripe\View\Parsers\ShortcodeParser; use Sunnysideup\DMS\Model\DMSDocument; use SilverStripe\ErrorPage\ErrorPage; - - /** * Handles replacing `dms_document_link` shortcodes with links to the actual * document. diff --git a/src/Extensions/DMSDocumentTaxonomyExtension.php b/src/Extensions/DMSDocumentTaxonomyExtension.php index f194bf2..977af19 100644 --- a/src/Extensions/DMSDocumentTaxonomyExtension.php +++ b/src/Extensions/DMSDocumentTaxonomyExtension.php @@ -2,9 +2,6 @@ namespace Sunnysideup\DMS\Extensions; - - - use TaxonomyTerm; use SilverStripe\Forms\FieldList; @@ -13,9 +10,6 @@ use SilverStripe\Core\Config\Config; use Sunnysideup\DMS\Extensions\DMSTaxonomyTypeExtension; use SilverStripe\ORM\DataExtension; - - - /** * ### @@@@ START REPLACEMENT @@@@ ### * WHY: upgrade to SS4 diff --git a/src/Extensions/DMSSiteTreeExtension.php b/src/Extensions/DMSSiteTreeExtension.php index ee230c2..4e9cfaa 100644 --- a/src/Extensions/DMSSiteTreeExtension.php +++ b/src/Extensions/DMSSiteTreeExtension.php @@ -2,16 +2,6 @@ namespace Sunnysideup\DMS\Extensions; - - - - - - - - - - use Sunnysideup\DMS\Model\DMSDocumentSet; use SilverStripe\Forms\FieldList; use SilverStripe\Security\Member; @@ -24,8 +14,6 @@ use SilverStripe\ORM\ArrayList; use SilverStripe\Versioned\Versioned; use SilverStripe\ORM\DataExtension; - - /** * @package dms */ diff --git a/src/Extensions/DMSTaxonomyTypeExtension.php b/src/Extensions/DMSTaxonomyTypeExtension.php index 5efeff2..2009ae9 100644 --- a/src/Extensions/DMSTaxonomyTypeExtension.php +++ b/src/Extensions/DMSTaxonomyTypeExtension.php @@ -2,13 +2,10 @@ namespace Sunnysideup\DMS\Extensions; - - use TaxonomyType; use SilverStripe\Core\Config\Config; use SilverStripe\ORM\DataExtension; - /** * Creates default taxonomy type records if they don't exist already */ diff --git a/src/Forms/DMSJsonField.php b/src/Forms/DMSJsonField.php index e356234..38283b5 100644 --- a/src/Forms/DMSJsonField.php +++ b/src/Forms/DMSJsonField.php @@ -2,15 +2,10 @@ namespace Sunnysideup\DMS\Forms; - - - use SilverStripe\Forms\FieldList; use SilverStripe\Core\Convert; use SilverStripe\Forms\CompositeField; - - /** * Combines form inputs into a key-value pair */ @@ -106,7 +101,7 @@ class DMSJsonField extends CompositeField * * @return $this */ - public function setValue($value, $data = NULL) + public function setValue($value, $data = null) { $this->value = $value; if (is_string($value) && !empty($value)) { diff --git a/src/Interfaces/DMSDocumentInterface.php b/src/Interfaces/DMSDocumentInterface.php index 16012d5..7f80ed6 100644 --- a/src/Interfaces/DMSDocumentInterface.php +++ b/src/Interfaces/DMSDocumentInterface.php @@ -2,14 +2,13 @@ namespace Sunnysideup\DMS\Interfaces; - - /** * Interface for a DMSDocument used in the Document Management System. A DMSDocument is create by storing a File * object in an instance of the DMSInterface. All write operations on the DMSDocument create a new relation, so we * never need to explicitly call the write() method on the DMSDocument DataObject */ -interface DMSDocumentInterface { +interface DMSDocumentInterface +{ /** * Returns a link to download this DMSDocument from the DMS store * @return String diff --git a/src/Interfaces/DMSInterface.php b/src/Interfaces/DMSInterface.php index 95925d2..7e6556b 100644 --- a/src/Interfaces/DMSInterface.php +++ b/src/Interfaces/DMSInterface.php @@ -2,30 +2,13 @@ namespace Sunnysideup\DMS\Interfaces; - use SilverStripe\CMS\Model\SiteTree; - - - - - - - - - - - - - - - - - /** * */ -interface DMSInterface { +interface DMSInterface +{ /** * Factory method that returns an instance of the DMS. This could be any class that implements the DMSInterface. * @static diff --git a/src/Model/DMSDocument.php b/src/Model/DMSDocument.php index 2e71835..07d3f57 100644 --- a/src/Model/DMSDocument.php +++ b/src/Model/DMSDocument.php @@ -2,17 +2,6 @@ namespace Sunnysideup\DMS\Model; - - - - - - - - - - - use Exception; @@ -97,8 +86,6 @@ use SilverStripe\Core\Convert; use SilverStripe\ORM\DataObject; use Sunnysideup\DMS\Interfaces\DMSDocumentInterface; - - /** * @package dms * @@ -142,14 +129,14 @@ class DMSDocument extends DataObject implements DMSDocumentInterface private static $table_name = 'DMSDocument'; -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: private static $db = (case sensitive) - * NEW: private static $db = (COMPLEX) - * EXP: Make sure to add a private static $table_name! - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: private static $db = (case sensitive) + * NEW: private static $db = (COMPLEX) + * EXP: Make sure to add a private static $table_name! + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ private static $db = array( "Filename" => "Varchar(255)", // eg. 3469~2011-energysaving-report.pdf "Folder" => "Varchar(255)", // eg. 0 @@ -170,14 +157,14 @@ class DMSDocument extends DataObject implements DMSDocumentInterface ); -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: private static $has_one = (case sensitive) - * NEW: private static $has_one = (COMPLEX) - * EXP: Make sure to add a private static $table_name! - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: private static $has_one = (case sensitive) + * NEW: private static $has_one = (COMPLEX) + * EXP: Make sure to add a private static $table_name! + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ private static $has_one = array( 'CoverImage' => Image::class, 'CreatedBy' => Member::class, @@ -759,14 +746,14 @@ class DMSDocument extends DataObject implements DMSDocumentInterface DMSDocument_versions::create_version($this); } else { //otherwise delete the old document file -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: ->getFullPath() (case sensitive) - * NEW: ->getFilename() (COMPLEX) - * EXP: You may need to add ASSETS_PATH."/" in front of this ... - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: ->getFullPath() (case sensitive) + * NEW: ->getFilename() (COMPLEX) + * EXP: You may need to add ASSETS_PATH."/" in front of this ... + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ $oldPath = $this->getFilename(); if (file_exists($oldPath)) { unlink($oldPath); @@ -1303,14 +1290,14 @@ class DMSDocument extends DataObject implements DMSDocumentInterface $fields->addExtraClass('dmsdocument-documentdetails'); -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: ->dontEscape (case sensitive) - * NEW: ->dontEscape (COMPLEX) - * EXP: dontEscape is not longer in use for form fields, please use HTMLReadonlyField (or similar) instead. - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: ->dontEscape (case sensitive) + * NEW: ->dontEscape (COMPLEX) + * EXP: dontEscape is not longer in use for form fields, please use HTMLReadonlyField (or similar) instead. + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ $urlField->dontEscape = true; $this->extend('updateFieldsForFile', $fields); diff --git a/src/Model/DMSDocumentSet.php b/src/Model/DMSDocumentSet.php index fe6d87c..e8ca326 100644 --- a/src/Model/DMSDocumentSet.php +++ b/src/Model/DMSDocumentSet.php @@ -2,18 +2,6 @@ namespace Sunnysideup\DMS\Model; - - - - - - - - - - - - use GridFieldPaginatorWithShowAll; use GridFieldSortableRows; @@ -68,7 +56,6 @@ use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\Security\Permission; use SilverStripe\ORM\DataObject; - /** * A document set is attached to Pages, and contains many DMSDocuments * @@ -94,14 +81,14 @@ class DMSDocumentSet extends DataObject private static $table_name = 'DMSDocumentSet'; -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: private static $db = (case sensitive) - * NEW: private static $db = (COMPLEX) - * EXP: Make sure to add a private static $table_name! - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: private static $db = (case sensitive) + * NEW: private static $db = (COMPLEX) + * EXP: Make sure to add a private static $table_name! + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ private static $db = array( 'Title' => 'Varchar(255)', 'KeyValuePairs' => 'Text', @@ -110,14 +97,14 @@ class DMSDocumentSet extends DataObject ); -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: private static $has_one = (case sensitive) - * NEW: private static $has_one = (COMPLEX) - * EXP: Make sure to add a private static $table_name! - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: private static $has_one = (case sensitive) + * NEW: private static $has_one = (COMPLEX) + * EXP: Make sure to add a private static $table_name! + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ private static $has_one = array( 'Page' => SiteTree::class, ); @@ -509,7 +496,8 @@ class DMSDocumentSet extends DataObject $member = Member::currentUser(); } - $result = ($member && + $result = ( + $member && Permission::checkMember( $member, array('ADMIN', 'SITETREE_EDIT_ALL', 'CMS_ACCESS_DMSDocumentAdmin') diff --git a/src/Model/DMSDocument_Controller.php b/src/Model/DMSDocument_Controller.php index 6de53ef..9ec4fb5 100644 --- a/src/Model/DMSDocument_Controller.php +++ b/src/Model/DMSDocument_Controller.php @@ -2,10 +2,6 @@ namespace Sunnysideup\DMS\Model; - - - - use InvalidArgumentException; use SilverStripe\Versioned\Versioned; @@ -16,8 +12,6 @@ use Sunnysideup\DMS\Model\DMSDocument; use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\Controller; - - class DMSDocument_Controller extends Controller { /** diff --git a/src/Model/DMSDocument_versions.php b/src/Model/DMSDocument_versions.php index ac29194..f38cb39 100644 --- a/src/Model/DMSDocument_versions.php +++ b/src/Model/DMSDocument_versions.php @@ -2,12 +2,6 @@ namespace Sunnysideup\DMS\Model; - - - - - - use Sunnysideup\DMS\Model\DMSDocument; use Sunnysideup\DMS\Interfaces\DMSDocumentInterface; use SilverStripe\ORM\DataObject; @@ -17,8 +11,6 @@ use Sunnysideup\DMS\DMS; use SilverStripe\Assets\File; use SilverStripe\ORM\DB; - - /** * DataObject to store versions of uploaded Documents. * @@ -38,42 +30,42 @@ class DMSDocument_versions extends DataObject public static $enable_versions = true; -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * OLD: private static $db (case sensitive) - * NEW: - private static $table_name = '[SEARCH_REPLACE_CLASS_NAME_GOES_HERE]'; - - private static $db (COMPLEX) - * EXP: Check that is class indeed extends DataObject and that it is not a data-extension! - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * OLD: private static $db (case sensitive) + * NEW: + private static $table_name = '[SEARCH_REPLACE_CLASS_NAME_GOES_HERE]'; + + private static $db (COMPLEX) + * EXP: Check that is class indeed extends DataObject and that it is not a data-extension! + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ private static $table_name = 'DMSDocument_versions'; -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: private static $db = (case sensitive) - * NEW: private static $db = (COMPLEX) - * EXP: Make sure to add a private static $table_name! - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: private static $db = (case sensitive) + * NEW: private static $db = (COMPLEX) + * EXP: Make sure to add a private static $table_name! + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ private static $db = array( 'VersionCounter' => 'Int', 'VersionViewCount' => 'Int' ); -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: private static $has_one = (case sensitive) - * NEW: private static $has_one = (COMPLEX) - * EXP: Make sure to add a private static $table_name! - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: private static $has_one = (case sensitive) + * NEW: private static $has_one = (COMPLEX) + * EXP: Make sure to add a private static $table_name! + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ private static $has_one = array( 'Document' => DMSDocument::class ); @@ -119,14 +111,14 @@ class DMSDocument_versions extends DataObject $success = false; -/** - * ### @@@@ START REPLACEMENT @@@@ ### - * WHY: upgrade to SS4 - * OLD: ->getFullPath() (case sensitive) - * NEW: ->getFilename() (COMPLEX) - * EXP: You may need to add ASSETS_PATH."/" in front of this ... - * ### @@@@ STOP REPLACEMENT @@@@ ### - */ + /** + * ### @@@@ START REPLACEMENT @@@@ ### + * WHY: upgrade to SS4 + * OLD: ->getFullPath() (case sensitive) + * NEW: ->getFilename() (COMPLEX) + * EXP: You may need to add ASSETS_PATH."/" in front of this ... + * ### @@@@ STOP REPLACEMENT @@@@ ### + */ $existingPath = $doc->getFilename(); if (is_file($existingPath)) { $docData = $doc->toMap(); diff --git a/src/Tasks/MigrateToDocumentSetsTask.php b/src/Tasks/MigrateToDocumentSetsTask.php index f444871..3f855b2 100644 --- a/src/Tasks/MigrateToDocumentSetsTask.php +++ b/src/Tasks/MigrateToDocumentSetsTask.php @@ -2,12 +2,6 @@ namespace Sunnysideup\DMS\Tasks; - - - - - - use SilverStripe\CMS\Model\SiteTree; use SilverStripe\ORM\Queries\SQLSelect; use Sunnysideup\DMS\Model\DMSDocument; @@ -15,7 +9,6 @@ use Sunnysideup\DMS\Model\DMSDocumentSet; use SilverStripe\Control\Director; use SilverStripe\Dev\BuildTask; - /** * This build task helps to migrate DMS data structures from DMS 1.x to 2.x which introduces document sets. * diff --git a/src/Tools/ShortCodeRelationFinder.php b/src/Tools/ShortCodeRelationFinder.php index 420cebe..c75616d 100644 --- a/src/Tools/ShortCodeRelationFinder.php +++ b/src/Tools/ShortCodeRelationFinder.php @@ -2,10 +2,6 @@ namespace Sunnysideup\DMS\Tools; - - - - use SilverStripe\CMS\Model\SiteTree; use SilverStripe\ORM\DataList; use Sunnysideup\DMS\DMS; @@ -13,7 +9,6 @@ use SilverStripe\Core\ClassInfo; use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\DataObject; - /** * Finds {@link DataObject} instances using certain shortcodes * by fulltext-querying only fields which are capable of parsing shortcodes. diff --git a/tests/extensions/DMSSiteTreeExtensionTest.php b/tests/extensions/DMSSiteTreeExtensionTest.php index eab63f2..4869a69 100644 --- a/tests/extensions/DMSSiteTreeExtensionTest.php +++ b/tests/extensions/DMSSiteTreeExtensionTest.php @@ -12,7 +12,7 @@ class DMSSiteTreeExtensionTest extends SapphireTest { protected static $fixture_file = 'dms/tests/dmstest.yml'; - protected $required_extensions = array( + protected static $required_extensions = array( 'SiteTree' => array(DMSSiteTreeExtension::class) ); diff --git a/tests/extensions/DMSTaxonomyTypeExtensionTest.php b/tests/extensions/DMSTaxonomyTypeExtensionTest.php index 83dbb49..ad85e74 100644 --- a/tests/extensions/DMSTaxonomyTypeExtensionTest.php +++ b/tests/extensions/DMSTaxonomyTypeExtensionTest.php @@ -8,7 +8,7 @@ class DMSTaxonomyTypeExtensionTest extends SapphireTest { protected $usesDatabase = true; - protected $required_extensions = array( + protected static $required_extensions = array( 'TaxonomyType' => array(DMSTaxonomyTypeExtension::class) );