Soundcloud embeds not loading with error "You have not provided a valid SoundCloud URL."

Created on 20 September 2023, over 1 year ago

Problem/Motivation

We received reports of Soundcloud embeds no longer loading on our D7 sites. I traced it to Soundcloud blocking cURL requests which this issue πŸ› Soundcloud blocking cURL requests, switch to drupal_http_request? Needs review attempts to fix. This issue relies on that one.

After patching from πŸ› Soundcloud blocking cURL requests, switch to drupal_http_request? Needs review , the embeds now load but with the error "You have not provided a valid SoundCloud URL."

Steps to reproduce

Using 7.x or 2.0.x, visit a page with a Soundcloud embed and see the embed widget loading but showing the error mentioned above.

In 7.x in soundcloudfield_field_formatter_view(), this line is breaking the embed:
$markup = str_replace($match[1], url($iframe_src_parts[0], array('query' => $url_params)), $markup);

In 2.0.x in SoundCloudDefaultFormatter.php, this line is breaking the embed:
$markup = str_replace($match[1], Url::fromUri($iframe_src_parts[0], ['query' => $url_params])->toString(), $markup);

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States vinmassaro

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024