Skip to content

Commit

Permalink
Merge branch '5' into 6
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 10, 2024
2 parents 7eb74af + b923eae commit 210fdc8
Show file tree
Hide file tree
Showing 5 changed files with 1,175 additions and 1,267 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions src/TopPage/DataExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use SilverStripe\View\ViewableData;
use SilverStripe\Forms\FieldList;
use SilverStripe\Core\Extension;
use SilverStripe\Dev\Deprecation;

/**
* Class DataExtension
Expand All @@ -23,6 +24,8 @@
* @method SiteTree TopPage()
*
* @extends Extension<BaseElement|ElementalArea|static>
*
* @deprecated 5.4.0 Will be replaced with DNADesign\Elemental\Extensions\TopPageElementExtension
*/
class DataExtension extends Extension
{
Expand Down Expand Up @@ -51,6 +54,17 @@ class DataExtension extends Extension
*/
private $fixedTopPageID = 0;

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with DNADesign\Elemental\Extensions\TopPageElementExtension',
Deprecation::SCOPE_CLASS
);
});
}

/**
* Extension point in @see DataObject::onAfterWrite()
*
Expand Down
14 changes: 14 additions & 0 deletions src/TopPage/FluentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SilverStripe\ORM\Queries\SQLUpdate;
use TractorCow\Fluent\State\FluentState;
use SilverStripe\Forms\FieldList;
use SilverStripe\Dev\Deprecation;

/**
* Class FluentExtension
Expand All @@ -19,6 +20,8 @@
* @property string $TopPageLocale
*
* @extends DataExtension<DataObject&static>
*
* @deprecated 5.4.0 Will be replaced with DNADesign\Elemental\Extensions\TopPageFluentElementExtension
*/
class FluentExtension extends DataExtension
{
Expand All @@ -29,6 +32,17 @@ class FluentExtension extends DataExtension
'TopPageLocale' => 'Varchar',
];

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with DNADesign\Elemental\Extensions\TopPageFluentElementExtension',
Deprecation::SCOPE_CLASS
);
});
}

protected function updateCMSFields(FieldList $fields)
{
$fields->removeByName('TopPageID');
Expand Down
16 changes: 16 additions & 0 deletions src/TopPage/SiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Core\Extension;
use SilverStripe\Dev\Deprecation;

/**
* Class SiteTreeExtension
*
* This extension must be present on pagetypes that need to support Elemental TopPage functionality.
* It can be applied directly to Page, as it only takes effect in the presence of a ElementalArea.
*
* @extends Extension<SiteTree&static>
*
* @deprecated 5.4.0 Will be replaced with DNADesign\Elemental\Extensions\TopPageSiteTreeExtension
*/
class SiteTreeExtension extends Extension
{
Expand All @@ -30,6 +35,17 @@ class SiteTreeExtension extends Extension
*/
protected $duplicatedObjects = [];

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with DNADesign\Elemental\Extensions\TopPageSiteTreeExtension',
Deprecation::SCOPE_CLASS
);
});
}

/**
* Extension point in @see DataObject::onAfterWrite()
*
Expand Down
Loading

0 comments on commit 210fdc8

Please sign in to comment.