Upgrade to SilverStripe 6#44
Conversation
- Update PHP requirement to ^8.1 - Update core dependencies to SS6 versions: - silverstripe/linkfield: ^4 → ^5 - silverstripe/recipe-cms: ^5 → ^6 - silverstripe/recipe-testing: ^3 → ^4 - dnadesign/silverstripe-elemental: ^5 → ^6 - symbiote/silverstripe-gridfieldextensions: ^4 → ^5 - Replace deprecated SilverStripe\ORM\DataExtension with SilverStripe\Core\Extension - Set branch-alias to dev-master: 3.0.x-dev
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the module to SilverStripe 6 compatibility, targeting a 3.0.0 release. The main changes include updating PHP requirements, upgrading all SilverStripe dependencies to v6-compatible versions, and replacing deprecated extension classes.
- Updated minimum PHP version from unspecified to ^8.1
- Upgraded core SilverStripe dependencies to v6 (recipe-cms, linkfield, elemental, gridfieldextensions, recipe-testing)
- Replaced deprecated
DataExtensionwithCore\Extensionin CarouselPageExtension
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Extension/CarouselPageExtension.php | Updated base class from deprecated DataExtension to Core\Extension |
| composer.json | Updated PHP requirement to ^8.1 and upgraded all SilverStripe dependencies to v6-compatible versions; updated branch-alias to 3.0.x-dev |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @method \SilverStripe\ORM\ManyManyThroughList|Slide[] Slides() | ||
| */ | ||
| class CarouselPageExtension extends DataExtension | ||
| class CarouselPageExtension extends Extension |
There was a problem hiding this comment.
Incorrect base class for ORM extension. CarouselPageExtension should extend SilverStripe\ORM\DataExtension, not SilverStripe\Core\Extension. The class uses ORM-specific features like $db, $many_many, and updateCMSFields, which require DataExtension. In SilverStripe 6, DataExtension is not deprecated - only its import path remains the same at SilverStripe\ORM\DataExtension.
| "extra": { | ||
| "branch-alias": { | ||
| "dev-main": "2.x-dev" | ||
| "dev-master": "3.0.x-dev" |
There was a problem hiding this comment.
Incorrect branch name in branch-alias. The branch should be 'dev-main' (as indicated by the diff showing it was previously 'dev-main'), not 'dev-master'. Most repositories use 'main' as the default branch name.
| "dev-master": "3.0.x-dev" | |
| "dev-main": "3.0.x-dev" |
- Change branch-alias from dev-master to dev-main (repo uses main as default branch) - Update unclecheese/display-logic from ^3.0 to ^4.0 for SS6 compatibility
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| use Dynamic\Carousel\Model\Slide; | ||
| use SilverStripe\Forms\FieldList; | ||
| use SilverStripe\ORM\DataExtension; | ||
| use SilverStripe\Core\Extension; |
There was a problem hiding this comment.
This change from DataExtension to Extension is incorrect. CarouselPageExtension defines ORM properties ($db, $many_many, $many_many_extraFields, $owns, $cascade_duplicates, $cascade_deletes) and uses ORM methods like getOwner()->exists(), getOwner()->dbObject(), and onBeforeWrite().
These features are provided by SilverStripe\ORM\DataExtension, not the base SilverStripe\Core\Extension class. DataExtension is not deprecated in SilverStripe 6 - it's the correct base class for extensions that add database functionality to DataObjects.
This should be reverted to:
use SilverStripe\ORM\DataExtension;- nathancox/embedfield ^3.0 requires framework ^4.11|^5 (SS5 only) - fromholdio/silverstripe-embedfield ^5.1 requires framework ^6.0 (SS6) - fromholdio is an actively maintained fork with same functionality - Latest release 5.1.0 from Nov 17, 2025
- jonom/focuspoint ^5 requires asset-admin ^2 (SS5) - jonom/focuspoint ^6 requires asset-admin ^3 (SS6)
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| use Dynamic\Carousel\Model\Slide; | ||
| use SilverStripe\Forms\FieldList; | ||
| use SilverStripe\ORM\DataExtension; | ||
| use SilverStripe\Core\Extension; |
There was a problem hiding this comment.
This import should be use SilverStripe\ORM\DataExtension; instead of use SilverStripe\Core\Extension;. See the related comment on line 32 - this extension needs to extend DataExtension to support ORM features.
| "symbiote/silverstripe-gridfieldextensions": "^4", | ||
| "unclecheese/display-logic": "^3.0" | ||
| "php": "^8.1", | ||
| "fromholdio/silverstripe-embedfield": "^5.1", |
There was a problem hiding this comment.
This package change from nathancox/embedfield to fromholdio/silverstripe-embedfield will break existing code. The VideoSlide.php file still imports nathancox\EmbedField\Forms\EmbedField and nathancox\EmbedField\Model\EmbedObject, which need to be updated to use the new package's namespace. The namespace likely changed to Fromholdio\EmbedField or similar - please verify the correct namespace for version ^5.1 and update all imports accordingly.
- Use SilverStripe\Core\Extension instead of SilverStripe\ORM\DataExtension DataExtension class no longer exists in SS6 - Remove parent::onBeforeWrite() call (Extension doesn't have this method) - Change onBeforeWrite() visibility to protected (SS6 extension hook standard) - Update VideoSlide to use Fromholdio\EmbedField namespace Replaces nathancox\EmbedField which is not SS6 compatible Fixes the 'Class SilverStripe\ORM\DataExtension not found' error. Extensions in SS6 extend Core\Extension and lifecycle hooks are called via the extension system using invokeExtension().
The class.notFound ignores are no longer needed since we properly updated the namespace from nathancox\EmbedField to Fromholdio\EmbedField. PHPStan can now resolve these classes correctly.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| if (!$this->getOwner()->Interval || $this->getOwner()->Interval < 0) { | ||
| $this->getOwner()->Interval = self::$defaults['Interval']; | ||
| } |
There was a problem hiding this comment.
The removal of parent::onBeforeWrite() is potentially problematic. While SilverStripe\Core\Extension doesn't have an implementation of onBeforeWrite(), removing the parent call breaks the chain if this extension is ever subclassed. In SilverStripe, it's a best practice to always call parent::onBeforeWrite() in extension hooks to ensure proper behavior in inheritance chains.
Consider keeping the parent call:
protected function onBeforeWrite()
{
if (!$this->getOwner()->Interval || $this->getOwner()->Interval < 0) {
$this->getOwner()->Interval = self::$defaults['Interval'];
}
parent::onBeforeWrite();
}| } | |
| } | |
| parent::onBeforeWrite(); |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Upgrades the module to SilverStripe 6 compatibility.
Changes
SilverStripe\ORM\DataExtensionwithSilverStripe\Core\ExtensionTesting
This prepares the module for the 3.0.0 release.