From b5b16f02f6ae6221ec8c4d7e27e3867e04828654 Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Fri, 5 May 2023 08:53:58 +1200 Subject: [PATCH 1/2] FIX Update deprecation notice with correct message --- code/Model/EmbedResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/Model/EmbedResource.php b/code/Model/EmbedResource.php index 40615618d..1789ad6e4 100644 --- a/code/Model/EmbedResource.php +++ b/code/Model/EmbedResource.php @@ -5,7 +5,7 @@ use SilverStripe\Dev\Deprecation; /** - * @deprecated 1.2.0 Use SilverStripe\View\Embed\EmbedResource instead + * @deprecated 1.2.0 Use SilverStripe\View\Embed\EmbedContainer instead */ class EmbedResource extends \SilverStripe\View\Embed\EmbedResource { @@ -14,7 +14,7 @@ class EmbedResource extends \SilverStripe\View\Embed\EmbedResource */ public function __construct($url) { - Deprecation::notice('1.2.0', 'Use SilverStripe\View\Embed\EmbedResource instead', Deprecation::SCOPE_CLASS); + Deprecation::notice('1.2.0', 'Use SilverStripe\View\Embed\EmbedContainer instead', Deprecation::SCOPE_CLASS); parent::__construct($url); } } From 206cb48a9e5590eca850a636d4a15a009f8aa32d Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Thu, 11 May 2023 10:58:37 +1200 Subject: [PATCH 2/2] FIX Broken Insert Image behat test --- tests/behat/src/FixtureContext.php | 42 +++++++++++++++++------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/tests/behat/src/FixtureContext.php b/tests/behat/src/FixtureContext.php index 84fd5902a..b62b93c4b 100644 --- a/tests/behat/src/FixtureContext.php +++ b/tests/behat/src/FixtureContext.php @@ -450,28 +450,34 @@ public function iShouldSeeTheTableGalleryFolderInPosition(string $name, string $ * @param string $field */ public function iSelectTheImageInHtmlField($filename, $field) + { + $this->selectInTheHtmlField("img[src*='$filename']", $field); + } + + /** + * Selects the first match of $select in the given HTML editor (tinymce) + */ + protected function selectInTheHtmlField(string $select, string $field) { $inputField = $this->getHtmlField($field); + $inputField->getParent()->find('css', 'iframe')->click(); $inputFieldId = $inputField->getAttribute('id'); - $filename = addcslashes($filename ?? '', "'"); $js = <<getMainContext()->getSession()->executeScript($js); }