Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/deploy 20240117 #704

Merged
merged 35 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
579b5f7
chore: composer update
orakili Dec 14, 2023
ac7ce55
chore: bump mysql image in tests
lazysoundsystem Dec 20, 2023
638575b
Merge pull request #692 from UN-OCHA/composer-update-20231214
lazysoundsystem Jan 2, 2024
fc910a6
chore: update base theme to most recent release
left23 Jan 3, 2024
873808e
Merge pull request #696 from UN-OCHA/CD-519-base-theme
left23 Jan 3, 2024
dd237cf
Merge pull request #693 from UN-OCHA/OPS-9749-bump-mysql-image-in-tests
orakili Jan 9, 2024
c557c79
chore: update drush to 12+
orakili Jan 9, 2024
eca16aa
chore: Add country icons
attiks Jan 10, 2024
cca7753
chore: Fallback to country icon
attiks Jan 10, 2024
98c813f
chore: Fallback to country icon for all entities
attiks Jan 10, 2024
e56f3ad
chore: Do not send email
attiks Jan 10, 2024
6bb4d00
chore: Do not send email
attiks Jan 10, 2024
e98c3c9
chore: Do not send email
attiks Jan 10, 2024
61d7f7f
test: Test meta images
attiks Jan 10, 2024
a919079
chore: update to Drupal 10.2 + compatibility patches for upload valid…
orakili Jan 10, 2024
7691840
test: Test meta images
attiks Jan 10, 2024
5ea84ec
fix: handle entities (ex: remote jobs) without a country for og:image
orakili Jan 11, 2024
6ad5299
Merge pull request #700 from UN-OCHA/RW-821-no-countries
orakili Jan 11, 2024
f7aa701
Merge pull request #698 from UN-OCHA/RW-821
attiks Jan 11, 2024
13fc215
chore: update reliefweb_files to use new upload validator API
orakili Jan 11, 2024
e8991f8
Merge branch 'develop' into drupal-10.2-update
orakili Jan 11, 2024
130aefd
chore: update dependencies
orakili Jan 11, 2024
0eac9cb
chore: sync config
orakili Jan 11, 2024
5d9eac9
chore: update allowed_formats module
orakili Jan 11, 2024
6883006
Merge pull request #703 from UN-OCHA/drupal-10.2-update
attiks Jan 11, 2024
0d7e7a9
Merge branch 'develop' into feature/deploy-20240117
attiks Jan 11, 2024
6bd468e
chore: Prep deploy 20240117
attiks Jan 11, 2024
a43e4bf
chore(deps-dev): bump follow-redirects
dependabot[bot] Jan 11, 2024
aac08a4
Merge pull request #701 from UN-OCHA/dependabot/npm_and_yarn/html/the…
orakili Jan 11, 2024
3059fc2
refactor: replace class override with new hook to flush webp images
orakili Jan 11, 2024
f39ae5d
Merge pull request #705 from UN-OCHA/RW-816-hook
orakili Jan 12, 2024
43bf4dd
Merge pull request #706 from UN-OCHA/develop
orakili Jan 12, 2024
4d0d23c
chore: update base theme to v3
left23 Jan 15, 2024
2fad406
Merge pull request #708 from UN-OCHA/RW-841
orakili Jan 15, 2024
355cfc7
Merge branch 'develop' into feature/deploy-20240117
orakili Jan 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
uses: cafuego/command-output@main
with:
run: |
docker compose -f tests/docker-compose.yml exec -T drupal drush -y si --existing-config
docker compose -f tests/docker-compose.yml exec -T drupal drush -y si --existing-config minimal install_configure_form.enable_update_status_emails=NULL
env:
fail-fast: true

Expand Down
14 changes: 0 additions & 14 deletions PATCHES/common_design--default-logo-remove.patch

This file was deleted.

174 changes: 98 additions & 76 deletions PATCHES/core--drupal--3008292-image-upload-validators.patch

Large diffs are not rendered by default.

26 changes: 0 additions & 26 deletions PATCHES/stage_file_proxy-webp-support-fix-3171559.patch

This file was deleted.

60 changes: 60 additions & 0 deletions PATCHES/svg_image--3413668--drupal-10.2-compatibility.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
diff --git a/src/Plugin/Field/FieldWidget/SvgImageWidget.php b/src/Plugin/Field/FieldWidget/SvgImageWidget.php
index 6a108c031b48e1a1cdd289bcab01425748a049dc..9f1fd50061deb939b166baae7ed3d565aeb3b72b 100755
--- a/src/Plugin/Field/FieldWidget/SvgImageWidget.php
+++ b/src/Plugin/Field/FieldWidget/SvgImageWidget.php
@@ -184,18 +184,46 @@ class SvgImageWidget extends FileWidget {

$fieldSettings = $this->getFieldSettings();

- // Add upload resolution validation.
- if ($fieldSettings['max_resolution'] || $fieldSettings['min_resolution']) {
- $element['#upload_validators']['file_validate_image_resolution'] = [$fieldSettings['max_resolution'], $fieldSettings['min_resolution']];
+ // Druapal 10.2 changes the file validation API.
+ // @see https://www.drupal.org/node/3363700
+ if (version_compare(\Drupal::VERSION, '10.2', '>=')) {
+ // Add image validation.
+ $element['#upload_validators']['FileIsImage'] = [];
+
+ // Add upload resolution validation.
+ if ($fieldSettings['max_resolution'] || $fieldSettings['min_resolution']) {
+ $element['#upload_validators']['FileImageDimensions'] = [
+ 'maxDimensions' => $fieldSettings['max_resolution'],
+ 'minDimensions' => $fieldSettings['min_resolution'],
+ ];
+ }
+
+ // If not using custom extension validation, ensure this is an image.
+ $supportedExtensions = $this->imageFactory->getSupportedExtensions();
+ $supportedExtensions[] = 'svg';
+ $extensions = $element['#upload_validators']['FileExtension']['extensions'] ?? implode(' ', $supportedExtensions);
+
+ $extensions = array_intersect(explode(' ', $extensions), $supportedExtensions);
+ $element['#upload_validators']['FileExtension']['extensions'] = implode(' ', $extensions);
}
+ // Backward compatibility with Drupal < 10.2.
+ else {
+ // Add upload resolution validation.
+ if ($fieldSettings['max_resolution'] || $fieldSettings['min_resolution']) {
+ $element['#upload_validators']['file_validate_image_resolution'] = [
+ $fieldSettings['max_resolution'],
+ $fieldSettings['min_resolution'],
+ ];
+ }

- // If not using custom extension validation, ensure this is an image.
- $supportedExtensions = $this->imageFactory->getSupportedExtensions();
- $supportedExtensions[] = 'svg';
- $extensions = $element['#upload_validators']['file_validate_extensions'][0] ?? implode(' ', $supportedExtensions);
+ // If not using custom extension validation, ensure this is an image.
+ $supportedExtensions = $this->imageFactory->getSupportedExtensions();
+ $supportedExtensions[] = 'svg';
+ $extensions = $element['#upload_validators']['file_validate_extensions'][0] ?? implode(' ', $supportedExtensions);

- $extensions = array_intersect(explode(' ', $extensions), $supportedExtensions);
- $element['#upload_validators']['file_validate_extensions'][0] = implode(' ', $extensions);
+ $extensions = array_intersect(explode(' ', $extensions), $supportedExtensions);
+ $element['#upload_validators']['file_validate_extensions'][0] = implode(' ', $extensions);
+ }

// Add mobile device image capture acceptance.
$element['#accept'] = 'image/*';
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"composer/installers": "^1.12",
"cweagans/composer-patches": "^1.7",
"drupal/admin_denied": "^2.0",
"drupal/allowed_formats": "^2.0",
"drupal/allowed_formats": "^3",
"drupal/classy": "^1.0",
"drupal/components": "^3.0@beta",
"drupal/config_filter": "^2.2",
Expand Down Expand Up @@ -58,7 +58,7 @@
"drupal/token": "^1.11",
"drupal/user_display_name": "^1.0",
"drupal/username_enumeration_prevention": "^1.3",
"drush/drush": "^11.3",
"drush/drush": "^12",
"google/analytics-data": "^0.8.4",
"google/auth": "^1.21",
"league/commonmark": "^2.2",
Expand All @@ -70,7 +70,7 @@
"reliefweb/simple-autocomplete": "^v1.3",
"reliefweb/simple-datepicker": "^v1.3",
"symfony/uid": "^6.2",
"unocha/common_design": "^9.2",
"unocha/common_design": "^9.3",
"unocha/ocha_monitoring": "^1.0",
"webflo/drupal-finder": "^1.2.2"
},
Expand Down Expand Up @@ -106,7 +106,8 @@
"oomphinc/composer-installers-extender": true,
"orakili/composer-drupal-info-file-patch-helper": true,
"phpstan/extension-installer": true,
"symfony/flex": true
"symfony/flex": true,
"php-http/discovery": true
}
},
"autoload": {
Expand Down
Loading