Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
getVideoId() should be validated when called in renderEmbedCode().
getVideoId() should be validated when called in renderEmbedCode().
Comments
Comment #2
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedIt should be impossible for getVideoId to return false. A provider should only be instantiated with valid ID, as verified and extracted by getIdFromInput. Can you give me some sample input which creates this situation?
Comment #3
ckngCan't recall where 500 was generated, have fixed the data since. But I believe it was due to bad input data (migrated) to the video field, so returning no valid id.
Possibly related:
When using drush, always getting
So for example in src/Plugin/video_embed_field/Provider/YouTube.php, renderEmbedCode() should always check and abort if $this->getVideoId() is returning FALSE.
Comment #4
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedAh okay, if the data was migrated, the input widget wouldn't have validated an ID was actually extracted. A few things that can happen here:
I also wonder why drush is calling a field formatter? If you put a debugger on the 'loadProviderFromInput' method, what is the input that is triggering FALSE?
Comment #5
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedAlso, as a side note are the migrations generic? Can they be merged into the module?
Comment #6
ckngThe $provider from loadProviderFromInput() is FALSE. Because the $item->value is "thisissometext---http://youtube..."
BTW, it was triggered by cron when indexing content.
For migration I merely using migration template:
Comment #7
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedI think we can safely catch download errors. getLocalThumbnailUri might reference a file that doesn't exist, but it would then just show a broken image, vs tanking the whole page and indexing, like you are having issues with.
Comment #9
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #11
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commented