Skip to content

Commit

Permalink
Remove Drupal 8.7 compat and Be totally Drupal 9.0 compliant
Browse files Browse the repository at this point in the history
And since we depend on webform, let's use the version that Drupal 9 loves too
5.19
  • Loading branch information
DiegoPino committed Jul 9, 2020
1 parent 7263790 commit 879e03d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
}
],
"require": {
"ml/json-ld": "^1.1",
"ml/json-ld": "^1.2",
"mtdowling/jmespath.php":"^2.5",
"strawberryfield/strawberryfield":"dev-8.x-1.0-beta3",
"strawberryfield/format_strawberryfield":"dev-8.x-1.0-beta3",
"drupal/webform": "^5.9",
"drupal/webform": "^5.19",
"drupal/webform_views": "^5.0"
}
}
5 changes: 2 additions & 3 deletions webform_strawberryfield.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: Strawberry Field Webform Integration
description: Provides Webform integrations to feed a field of Strawberries.
package: Archipelago
type: module
core: 8.x
core_version_requirement: ^8.8 || ^9
php: 7.1
dependencies:
- 'drupal:field'
- 'drupal:file'
- 'drupal:system (>= 8.7)'
- 'drupal:user'
- 'strawberryfield'
- 'webform:webform (>= 8.x-5.3)'
- 'webform:webform (>= 8.x-5.19)'
18 changes: 5 additions & 13 deletions webform_strawberryfield.module
Original file line number Diff line number Diff line change
Expand Up @@ -340,20 +340,12 @@ function webform_strawberryfield_preprocess_webform_element_image_file(
$iiifserversettings->get('pub_server_url'),
$iiifserversettings->get('int_server_url')
);
// Deal with Drupal 8.8.x v/s 8.7
if (method_exists(
\Drupal::service('stream_wrapper_manager'),
'getTarget'
)) {
$iiifidentifier = urlencode(
\Drupal::service('stream_wrapper_manager')->getTarget(
// Deal with Drupal 8.8.x only now
$iiifidentifier = urlencode(
\Drupal::service('stream_wrapper_manager')->getTarget(
$file->getFileUri()
)
);
}
else {
$iiifidentifier = urlencode(file_uri_target($file->getFileUri()));
}
)
);

if ($iiifidentifier == NULL || empty($iiifidentifier)) {
// Nothing to do, lets leave this untouched.
Expand Down

0 comments on commit 879e03d

Please sign in to comment.