- πΊπΈUnited States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β as a guide.
FYI #21 cleanly applied to 9.5.x and 10.1.x so reroll in #23 was unnecessary. Can verify a patch still applies locally or by clicking retest
So reviewing #23 patch
OEmbedFormatter
1. The new parameter will have to default to NULL for BC with a trigger_error this will be required in 11
2. A. test will need to be added to verify that.This feature will need test cases
Also a change record the new parameter needed for OEmbedFormatter and to announce the new feature.
I don't know if it is just me but I am getting an error when I use this patch #21 β .
The issue happens when I am passing an array in the context like this:
<?php function MY_MODULE_oembed_formatter_context_alter(array &$context, \Drupal\Core\Field\FormatterInterface $plugin, \Drupal\media\OEmbed\Resource $resource) { .... if (isset($settings['background_video']) && $settings['background_video']) { $context['background_video'] = $settings['background_video']; } }
When I load the page, the line 139 from the method render is called from Drupal\media\ControllerOEmbedIframeController::
<?php public function render(Request $request) { .... $context = $request->query->get('context', NULL); .... } ?>
I am getting the error from this class Symfony\Component\HttpFoundation\InputBag: "Input value "context" contains a non-scalar value.". The context has this format:
["background_video => "1"]
I think the error is on this file Drupal\media\Controller\OEmbedIframeController line 139:
<?php public function render(Request $request) { .... $context = $request->query->get('context', NULL); .... } ?>
It should be instead
<?php public function render(Request $request) { .... $context = $request->query->all('context', NULL); .... } ?>
The reason is because an array is never a scalar value.
Hi marthinal, thanks for the new patch for 10.1.x-dev. Unfortunately with this patch #26 β the hook_oembed_formatter_context_alter is not triggered causing the context not being set with the information passed from the backend.
- last update
over 1 year ago Patch Failed to Apply This patch works for me. It triggers the hook correctly and pass the value of the context array without throwing any errors. It is a copy of #21 β but with the changes from #25 β¨ Allow passing context information to media_oembed_iframe theme implementation. Needs work .
- πͺπΈSpain marthinal
Thanks @rodetrev. We also found some regressions. Your patch looks correct. Re-rolled. Needs more QA
- Status changed to Needs review
about 1 year ago 9:27am 27 September 2023 - last update
about 1 year ago 29,640 pass - last update
about 1 year ago 29,640 pass - last update
about 1 year ago Patch Failed to Apply - Status changed to Needs work
about 1 year ago 5:51pm 27 September 2023 - πΊπΈUnited States smustgrave
Was previously tagged for tests, which are still needed.
Have not yet reviewed.
- last update
about 1 year ago 30,426 pass It is not possible to apply the patch #30 β in Drupal version 10.3.0.
I have created this patch 3006729-35.patch β that works with Drupal 10.3.0