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

Use FileUrlGeneratorInterface #996

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Use FileUrlGeneratorInterface #996

merged 2 commits into from
Nov 29, 2023

Conversation

seth-shaw-asu
Copy link
Member

GitHub Issue: N/A

Ran into an issue where I couldn't update an entity_view_display:

TypeError: Drupal\islandora\Plugin\Field\FieldFormatter\IslandoraImageFormatter::__construct(): Argument #11 ($file_url_generator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\cdn\File\FileUrlGenerator given, called in /var/www/html/drupal/web/modules/contrib/islandora/src/Plugin/Field/FieldFormatter/IslandoraImageFormatter.php on line 106 in /var/www/html/drupal/web/modules/contrib/islandora/src/Plugin/Field/FieldFormatter/IslandoraImageFormatter.php on line 63
#0 /var/www/html/drupal/web/modules/contrib/islandora/src/Plugin/Field/FieldFormatter/IslandoraImageFormatter.php(106): Drupal\islandora\Plugin\Field\FieldFormatter\IslandoraImageFormatter->__construct()
#1 /var/www/html/drupal/web/core/lib/Drupal/Core/Field/FormatterPluginManager.php(64): Drupal\islandora\Plugin\Field\FieldFormatter\IslandoraImageFormatter::create()
...

What does this Pull Request do?

Replaces FileUrlGenerator class with FileUrlGeneratorInterface which preserves compatibility with CDN replacements.

How should this be tested?

Not sure how to test this quickly. Mine was probably triggered by either our S3 integration or Cloudflare. Not sure which.

But, really, just smoke-test it and make sure tests pass.

Interested parties

@Islandora/committers

@seth-shaw-asu
Copy link
Member Author

As per https://www.drupal.org/project/drupal/issues/3403491, the test failures caught an unfortunate window where 10.2.x broke the API, but should be okay if I just retry them. 🤞

Copy link
Member

@whikloj whikloj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@whikloj whikloj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 👍 🤦

@whikloj whikloj merged commit c634164 into 2.x Nov 29, 2023
18 checks passed
@whikloj whikloj deleted the seth-shaw-asu-patch-1 branch November 29, 2023 18:10
rosiel pushed a commit that referenced this pull request Apr 2, 2024
* Use FileUrlGeneratorInterface

* Use FileUrlGeneratorInterface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants