From 1e522d6e1b412d4ae0a426c87aebece358aafb5c Mon Sep 17 00:00:00 2001
From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Date: Tue, 7 Jan 2025 17:14:04 +1300
Subject: [PATCH 1/2] API Remove deprecated API (#671)
---
src/Shortcodes/ImageShortcodeProvider.php | 23 -------------
src/Storage/DBFile.php | 1 -
.../Shortcodes/ImageShortcodeProviderTest.php | 34 -------------------
3 files changed, 58 deletions(-)
diff --git a/src/Shortcodes/ImageShortcodeProvider.php b/src/Shortcodes/ImageShortcodeProvider.php
index af5307b9..f9f9fc60 100644
--- a/src/Shortcodes/ImageShortcodeProvider.php
+++ b/src/Shortcodes/ImageShortcodeProvider.php
@@ -7,7 +7,6 @@
use SilverStripe\Assets\Image;
use SilverStripe\Core\Flushable;
use SilverStripe\Core\Injector\Injector;
-use SilverStripe\Dev\Deprecation;
use SilverStripe\View\Parsers\ShortcodeHandler;
use SilverStripe\View\Parsers\ShortcodeParser;
@@ -150,28 +149,6 @@ public static function handle_shortcode($args, $content, $parser, $shortcode, $e
return $markup;
}
- /**
- * Construct and return HTML image tag.
- *
- * @deprecated 2.3.0
- */
- public static function createImageTag(array $attributes) : string
- {
- Deprecation::notice('2.3.0', 'Will be removed without equivalent functionality to replace it.');
- $preparedAttributes = '';
- foreach ($attributes as $attributeKey => $attributeValue) {
- if (strlen($attributeValue ?? '') > 0 || $attributeKey === 'alt') {
- $preparedAttributes .= sprintf(
- ' %s="%s"',
- $attributeKey,
- htmlspecialchars($attributeValue ?? '', ENT_QUOTES, 'UTF-8', false)
- );
- }
- }
-
- return "";
- }
-
/**
* Regenerates "[image id=n]" shortcode with new src attribute prior to being edited within the CMS.
*
diff --git a/src/Storage/DBFile.php b/src/Storage/DBFile.php
index 794a30ad..42de943b 100644
--- a/src/Storage/DBFile.php
+++ b/src/Storage/DBFile.php
@@ -8,7 +8,6 @@
use SilverStripe\Control\Director;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\FormField;
-use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\FieldType\DBComposite;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\Core\Validation\ValidationResult;
diff --git a/tests/php/Shortcodes/ImageShortcodeProviderTest.php b/tests/php/Shortcodes/ImageShortcodeProviderTest.php
index 6951ed0c..9243d9aa 100644
--- a/tests/php/Shortcodes/ImageShortcodeProviderTest.php
+++ b/tests/php/Shortcodes/ImageShortcodeProviderTest.php
@@ -472,40 +472,6 @@ public function testWhiteIsConfigurable()
);
}
- public static function gettersAndSettersProvider(): array
- {
- return [
- 'image without special characters' => [
- '',
- [
- 'src' => 'http://example.com/image.jpg',
- 'alt' => 'My alt text',
- 'title' => 'My Title',
- 'width' => '300',
- 'height' => '200',
- 'class' => 'leftAlone ss-htmleditorfield-file image',
- ],
- ],
- 'image with special characters' => [
- '',
- [
- 'src' => 'http://example.com/image.jpg',
- 'alt' => 'My alt text & special character',
- 'title' => 'My Title & special character',
- 'width' => '300',
- 'height' => '200',
- 'class' => 'leftAlone ss-htmleditorfield-file image',
- ]
- ]
- ];
- }
-
- #[DataProvider('gettersAndSettersProvider')]
- public function testCreateImageTag(string $expected, array $attributes)
- {
- $this->assertEquals($expected, ImageShortcodeProvider::createImageTag($attributes));
- }
-
/**
* This method will assert that the $tag will contain an image with specific attributes and values
*
From 40864acfd3cca08cd05b5945b02bdc3bf8d755fc Mon Sep 17 00:00:00 2001
From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Date: Wed, 8 Jan 2025 09:40:27 +1300
Subject: [PATCH 2/2] DEP Don't include vendor-plugin as an explicit dependency
(#672)
We don't directly reference it in code or config, so we can rely on silverstripe/framework having this dependency for us.
---
composer.json | 1 -
1 file changed, 1 deletion(-)
diff --git a/composer.json b/composer.json
index 5b01747a..e4fb1d68 100644
--- a/composer.json
+++ b/composer.json
@@ -22,7 +22,6 @@
"php": "^8.3",
"silverstripe/framework": "^6",
"silverstripe/template-engine": "^1",
- "silverstripe/vendor-plugin": "^2",
"symfony/filesystem": "^7.0",
"intervention/image": "^3.9",
"league/flysystem": "^3.29",