StarCitizenWiki / mediawiki-extensions-EmbedVideo

GDPR focused EmbedVideo. Supports YouTube, Twitch, Spotify and SoundCloud
https://www.mediawiki.org/wiki/Extension:EmbedVideo_(fork)
Other
27 stars 15 forks source link

Leaving out the URL in evu leads to a backtrace instead of an error message #65

Closed fridtjof closed 1 year ago

fridtjof commented 1 year ago

Describe the bug Not specifying a URL for evu gives a backtrace instead of a user friendly error message

To Reproduce

  1. Use the evu tag without specifying a host like this: {{#evu:|}} (in our case this happens through old pages that use templates that did not enforce required parameters)
  2. Save the page
  3. Get a long backtrace

Expected behavior The mistake is handled graciously, and a user friendly error box is shown (EmbedVideo does this if there's no URL: https://gitlab.com/hydrawiki/extensions/EmbedVideo/-/blob/master/EmbedVideo.hooks.php?ref_type=heads#L356)

Screenshots

Backtrace given by this EmbedVideo:

grafik

Error as handled by original EmbedVideo:

grafik

Technical information:

octfx commented 1 year ago

Would you mind testing the develop branch? It addresses both your issues :)

fridtjof commented 1 year ago

Awesome, thanks!

Provider autodetection does not seem to work right when using evu - "VideoService "media" not recognized" is reported back. An example (with the same video used as example in #66): https://wiki.das-labor.org/w/Video/Introducing_utk-web_-_a_web_developers_view_on_firmware

I think the URL to host parsing only grabs 'media' out of 'media.ccc.de' here? https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo/blob/b2bbbb6b9ac128457a40aee736a5bd2aec3e6404/includes/EmbedVideo.php#L96C16-L96C16

octfx commented 1 year ago

That was an error on my side, fixed and tested in develop!

fridtjof commented 1 year ago

Thanks! I can confirm it works :) Closing both issues.