From 6430bbef01d1549064312a8c576cd3ca62677031 Mon Sep 17 00:00:00 2001
From: Chris Brody <chris.brody@iied.org>
Date: Tue, 31 Oct 2023 21:21:25 +0000
Subject: [PATCH 1/2] Update for php@8.2 deprecations

---
 flickr.info.yml                                          | 2 +-
 modules/flickr_colorbox/flickr_colorbox.info.yml         | 2 +-
 modules/flickr_filter/flickr_filter.info.yml             | 2 +-
 modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php | 2 +-
 src/Service/Helpers.php                                  | 1 +
 src/Service/Photos.php                                   | 1 +
 src/Service/Photosets.php                                | 1 +
 7 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/flickr.info.yml b/flickr.info.yml
index 552f527..d919604 100644
--- a/flickr.info.yml
+++ b/flickr.info.yml
@@ -5,6 +5,6 @@ configure: flickr.settings
 
 type: module
 core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
 dependencies:
   - flickr_api:flickr_api
diff --git a/modules/flickr_colorbox/flickr_colorbox.info.yml b/modules/flickr_colorbox/flickr_colorbox.info.yml
index ba1cc20..caedd20 100644
--- a/modules/flickr_colorbox/flickr_colorbox.info.yml
+++ b/modules/flickr_colorbox/flickr_colorbox.info.yml
@@ -3,7 +3,7 @@ type: module
 description: 'Loads Flickr images in Colorbox.'
 package: Flickr
 core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
 dependencies:
   - flickr:flickr
   - colorbox:colorbox
diff --git a/modules/flickr_filter/flickr_filter.info.yml b/modules/flickr_filter/flickr_filter.info.yml
index a2c553e..1951a01 100644
--- a/modules/flickr_filter/flickr_filter.info.yml
+++ b/modules/flickr_filter/flickr_filter.info.yml
@@ -3,6 +3,6 @@ type: module
 description: 'Flickr Filter module provides configurable filter to display Flickr images.'
 package: Flickr
 core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
 dependencies:
   - flickr:flickr
diff --git a/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php b/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php
index 7cf9036..2630be4 100644
--- a/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php
+++ b/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php
@@ -18,7 +18,7 @@ use Drupal\flickr\Service\Photos;
  *   id = "flickr_filter",
  *   title = @Translation("Embed Flickr photo"),
  *   description = @Translation("Allow users to embed a picture from Flickr website in an editable content area."),
- *   type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE,
+ *   type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
  *   settings = {
  *     "flickr_filter_imagesize" = 200,
  *   },
diff --git a/src/Service/Helpers.php b/src/Service/Helpers.php
index cf4b1d5..203bd4a 100644
--- a/src/Service/Helpers.php
+++ b/src/Service/Helpers.php
@@ -9,6 +9,7 @@ use Drupal\flickr_api\Service\Helpers as FlickrApiHelpers;
  *
  * @package Drupal\flickr\Service
  */
+#[AllowDynamicProperties]
 class Helpers {
 
   /**
diff --git a/src/Service/Photos.php b/src/Service/Photos.php
index 5aeb88a..41855df 100644
--- a/src/Service/Photos.php
+++ b/src/Service/Photos.php
@@ -10,6 +10,7 @@ use Drupal\flickr_api\Service\Helpers as FlickrApiHelpers;
  *
  * @package Drupal\flickr\Service
  */
+#[AllowDynamicProperties]
 class Photos {
 
   /**
diff --git a/src/Service/Photosets.php b/src/Service/Photosets.php
index 11aadcb..8451df1 100644
--- a/src/Service/Photosets.php
+++ b/src/Service/Photosets.php
@@ -10,6 +10,7 @@ use Drupal\flickr_api\Service\Helpers as FlickrApiHelpers;
  *
  * @package Drupal\flickr\Service
  */
+#[AllowDynamicProperties]
 class Photosets {
 
   /**
-- 
GitLab


From 53a5d3dac38a919f8a872f9e75bec7c1041d0d80 Mon Sep 17 00:00:00 2001
From: Chris Brody <chris.brody@iied.org>
Date: Tue, 31 Oct 2023 22:17:07 +0000
Subject: [PATCH 2/2] Fix deprecated render() calls

---
 modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php | 4 ++--
 src/Service/Helpers.php                                  | 2 +-
 src/Service/Photos.php                                   | 2 +-
 src/Service/Photosets.php                                | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php b/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php
index 2630be4..425e0f2 100644
--- a/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php
+++ b/modules/flickr_filter/src/Plugin/Filter/FlickrFilter.php
@@ -186,7 +186,7 @@ class FlickrFilter extends FilterBase implements ContainerFactoryPluginInterface
 
         $photoimg = $this->photos->themePhoto($photo, $config['size'], $config['caption']);
 
-        return render($photoimg);
+        return \Drupal::service('renderer')->render($photoimg);
       }
     }
 
@@ -325,7 +325,7 @@ class FlickrFilter extends FilterBase implements ContainerFactoryPluginInterface
     $photos = $this->photos->themePhotos($photosetPhotos['photo'], $config['size'], $config['caption'], $photosetPhotos['id']);
     $photoset = $this->photosets->themePhotoset($photos, $photosetPhotos['title']);
 
-    return render($photoset);
+    return \Drupal::service('renderer')->render($photoset);
   }
 
 }
diff --git a/src/Service/Helpers.php b/src/Service/Helpers.php
index 203bd4a..4a628cb 100644
--- a/src/Service/Helpers.php
+++ b/src/Service/Helpers.php
@@ -9,7 +9,7 @@ use Drupal\flickr_api\Service\Helpers as FlickrApiHelpers;
  *
  * @package Drupal\flickr\Service
  */
-#[AllowDynamicProperties]
+#[\AllowDynamicProperties]
 class Helpers {
 
   /**
diff --git a/src/Service/Photos.php b/src/Service/Photos.php
index 41855df..0f49397 100644
--- a/src/Service/Photos.php
+++ b/src/Service/Photos.php
@@ -10,7 +10,7 @@ use Drupal\flickr_api\Service\Helpers as FlickrApiHelpers;
  *
  * @package Drupal\flickr\Service
  */
-#[AllowDynamicProperties]
+#[\AllowDynamicProperties]
 class Photos {
 
   /**
diff --git a/src/Service/Photosets.php b/src/Service/Photosets.php
index 8451df1..fa931e5 100644
--- a/src/Service/Photosets.php
+++ b/src/Service/Photosets.php
@@ -10,7 +10,7 @@ use Drupal\flickr_api\Service\Helpers as FlickrApiHelpers;
  *
  * @package Drupal\flickr\Service
  */
-#[AllowDynamicProperties]
+#[\AllowDynamicProperties]
 class Photosets {
 
   /**
-- 
GitLab

