Skip to content

Commit

Permalink
Replaced use of deprecated DataExtension with Extension
Browse files Browse the repository at this point in the history
  • Loading branch information
UndefinedOffset committed Nov 7, 2024
1 parent 1871b19 commit 8ddd4e2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
composer config allow-plugins.composer/installers true
composer config allow-plugins.silverstripe/recipe-plugin true
composer config allow-plugins.silverstripe/vendor-plugin true
composer silverstripe/recipe-cms ~5.3
composer install --verbose --no-interaction --no-progress --no-suggest --optimize-autoloader --ansi
- name: Configure Environment
Expand Down Expand Up @@ -157,6 +158,7 @@ jobs:
composer config allow-plugins.composer/installers true
composer config allow-plugins.silverstripe/recipe-plugin true
composer config allow-plugins.silverstripe/vendor-plugin true
composer silverstripe/recipe-cms ~4.13
composer install --verbose --no-interaction --no-progress --no-suggest --optimize-autoloader --ansi
- name: Configure Environment
Expand Down Expand Up @@ -231,6 +233,7 @@ jobs:
run: |
composer self-update --ansi || true
if [[ $GITHUB_ACCESS_TOKEN ]]; then composer config --ansi -g github-oauth.github.com $GITHUB_ACCESS_TOKEN; fi
composer silverstripe/recipe-cms ~4.13
composer install --verbose --no-interaction --no-progress --no-suggest --optimize-autoloader --ansi
- name: Configure Environment
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [2.2.0](https://github.com/webbuilders-group/silverstripe-siteconfig-error-pages/tree/2.2.0) (2024-11-07)
[Full Changelog](https://github.com/webbuilders-group/silverstripe-siteconfig-error-pages/compare/2.1.0...2.2.0)

## [2.1.0](https://github.com/webbuilders-group/silverstripe-siteconfig-error-pages/tree/2.1.0) (2023-10-19)
[Full Changelog](https://github.com/webbuilders-group/silverstripe-siteconfig-error-pages/compare/2.0.0...2.1.0)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, The Web Builders Group Inc.
Copyright (c) 2024, The Web Builders Group Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
4 changes: 2 additions & 2 deletions src/Extensions/ErrorPageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
namespace WebbuildersGroup\SiteConfigErrorPages\Extensions;

use SilverStripe\Control\Controller;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Core\Extension;
use SilverStripe\SiteConfig\SiteConfigLeftAndMain;
use SilverStripe\View\HTML;

class ErrorPageExtension extends DataExtension
class ErrorPageExtension extends Extension
{
public function MetaTags(&$tags)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Extensions/SiteConfigExtension.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace WebbuildersGroup\SiteConfigErrorPages\Extensions;

use SilverStripe\Core\Extension;
use SilverStripe\ErrorPage\ErrorPage;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridField;
Expand All @@ -11,7 +12,6 @@
use SilverStripe\Forms\GridField\GridFieldDetailForm;
use SilverStripe\Forms\GridField\GridFieldEditButton;
use SilverStripe\Forms\GridField\GridFieldToolbarHeader;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Versioned\GridFieldArchiveAction;
use SilverStripe\Versioned\Versioned;
use WebbuildersGroup\GridFieldDeletedItems\Forms\GridFieldDeletedColumns;
Expand All @@ -21,7 +21,7 @@
use WebbuildersGroup\GridFieldDeletedItems\Forms\GridFieldDeletedToggle;
use WebbuildersGroup\SiteConfigErrorPages\Forms\GridField\ErrorPageItemRequestHandler;

class SiteConfigExtension extends DataExtension
class SiteConfigExtension extends Extension
{
/**
* Updates the CMS fields adding the fields defined in this extension
Expand All @@ -31,8 +31,8 @@ public function updateCMSFields(FieldList $fields)
{
// Reset Versioned
Versioned::set_reading_mode('Stage.' . Versioned::DRAFT);


$fields->findOrMakeTab('Root.ErrorPages', _t('WebbuildersGroup\\SiteConfigErrorPages\\Extensions\\SiteConfigErrorPagesExtension.ERROR_PAGES', 'Error Pages'));
$fields->addFieldToTab('Root.ErrorPages', $gridField = new GridField('ErrorPages', _t('WebbuildersGroup\\SiteConfigErrorPages\\Extensions\\SiteConfigErrorPagesExtension.ERROR_PAGES', 'Error Pages'), ErrorPage::get(), GridFieldConfig_RecordEditor::create(10)));
$gridField->getConfig()
Expand All @@ -55,7 +55,7 @@ public function updateCMSFields(FieldList $fields)
'isPublished' => 'Boolean->Nice',
'IsModifiedOnStage' => 'Boolean->Nice',
]);

$gridField->getConfig()
->getComponentByType(GridFieldDetailForm::class)
->setItemRequestClass(ErrorPageItemRequestHandler::class);
Expand Down

0 comments on commit 8ddd4e2

Please sign in to comment.