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

ADO with no media skips embargo context #177

Closed
aksm opened this issue Dec 9, 2021 · 1 comment
Closed

ADO with no media skips embargo context #177

aksm opened this issue Dec 9, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@aksm
Copy link
Contributor

aksm commented Dec 9, 2021

What?

Thanks to @giancarlobi testing Drupal 9.3.0, a bug was discovered where ADOs with no media can cause something like the following error:

A notice: Notice: Undefined variable: embargo_context in Drupal\format_strawberryfield\Plugin\Field\FieldFormatter\StrawberryMediaFormatter->viewElements() (line 244 of /var/www/archipelago/web/modules/contrib/format_strawberryfield/src/Plugin/Field/FieldFormatter/StrawberryMediaFormatter.php) #0 /var/www/archipelago/web/core/includes/bootstrap.inc(346): _d
12:53
Then error: TypeError: Argument 3 passed to Drupal\Core\Cache\Cache::mergeContexts() must be of the type array, null given, called in /var/www/archipelago/web/modules/contrib/format_strawberryfield/src/Plugin/Field/FieldFormatter/StrawberryMediaFormatter.php on line 244 in Drupal\Core\Cache\Cache::mergeContexts() (line 29 of /var/www/archipelago/web/core/lib/Drupal/Core/Cache/Cache.php) #0 /var/www/archipelago/web/modules/contrib/format_strawberryfield/src/Plugin/Field/FieldFormatter/StrawberryMediaFormatter.php(244): Drupal\Core\Cache\Cache::mergeContexts() #1 /var/www/archipelago/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\format_strawberryfield\Plugin\Field\FieldFormatter\StrawberryMediaFormatter->viewElements() #2 /var/www/archipelago/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(263): Drupal\Core\Field\FormatterBase->view()

@DiegoPino has already identified the likely culprit here:

@DiegoPino
Copy link
Member

Fixed via #178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants