From 081d26f292bd2ee888a050306542c65270d3c185 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 24 May 2023 17:21:58 +1000 Subject: [PATCH 1/4] Check required WordPress version to set galleryWithImageBlocks flag --- .../BlockEditorSettings+GutenbergEditorSettings.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift b/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift index 0b46c3ffdba7..9b45c04a789c 100644 --- a/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift +++ b/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift @@ -1,6 +1,7 @@ import Foundation import WordPressKit import Gutenberg +import Blog extension BlockEditorSettings: GutenbergEditorSettings { public var colors: [[String: String]]? { @@ -12,7 +13,14 @@ extension BlockEditorSettings: GutenbergEditorSettings { } public var galleryWithImageBlocks: Bool { - return experimentalFeature(.galleryWithImageBlocks) + // If site is using WP 5.9+ then return true as galleryWithImageBlocks is supported in WP 5.9+. + // Once support for WP 5.8 is dropped, this can be removed. + // https://github.com/WordPress/gutenberg/issues/47782 + if hasRequiredWordPressVersion("5.9") { + return true + } else { + return experimentalFeature(.galleryWithImageBlocks) + } } public var quoteBlockV2: Bool { From 42b10c881fd88af6ba7006fdf472d7748559c213 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 25 May 2023 09:17:27 +1000 Subject: [PATCH 2/4] Update hasRequiredWordPressVersion method to call from blog object instead of import --- .../Models/BlockEditorSettings+GutenbergEditorSettings.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift b/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift index 9b45c04a789c..511191b76672 100644 --- a/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift +++ b/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift @@ -1,7 +1,6 @@ import Foundation import WordPressKit import Gutenberg -import Blog extension BlockEditorSettings: GutenbergEditorSettings { public var colors: [[String: String]]? { @@ -16,7 +15,7 @@ extension BlockEditorSettings: GutenbergEditorSettings { // If site is using WP 5.9+ then return true as galleryWithImageBlocks is supported in WP 5.9+. // Once support for WP 5.8 is dropped, this can be removed. // https://github.com/WordPress/gutenberg/issues/47782 - if hasRequiredWordPressVersion("5.9") { + if blog.hasRequiredWordPressVersion("5.9") { return true } else { return experimentalFeature(.galleryWithImageBlocks) From f91fc0a9580829879fa863e88255f7ccc7dcc200 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 26 May 2023 16:09:13 +1000 Subject: [PATCH 3/4] Update RELEASE-NOTES for galleryWithImageBlocks issue --- RELEASE-NOTES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index d052848ead92..b18735be40ae 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,3 +1,7 @@ +22.6 +---- +* [**] Check required WordPress version to set galleryWithImageBlocks flag [#20736] + 22.5 ----- * [*] [Jetpack-only] Reader: Fix the display of the followed topics in the filter sheet when they're written in non-latin languages. [#20702] From 458c0410b8a1a84c8803077a4e895a3e90c89ef3 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Mon, 29 May 2023 10:45:02 +1000 Subject: [PATCH 4/4] Update RELEASE-NOTES --- RELEASE-NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index b18735be40ae..f152fa7b3bc4 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,6 +1,6 @@ 22.6 ---- -* [**] Check required WordPress version to set galleryWithImageBlocks flag [#20736] +* [**] [internal] Check required WordPress version to set "galleryWithImageBlocks" flag [#20736] 22.5 -----