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.
Problem/Motivation
Error: Call to undefined function Drupal\soundcloudfield\Plugin\Field\FieldFormatter\url() in Drupal\soundcloudfield\Plugin\Field\FieldFormatter\SoundCloudDefaultFormatter->viewElements() (line 283 of modules/contrib/soundcloudfield/src/Plugin/Field/FieldFormatter/SoundCloudDefaultFormatter.php).
Steps to reproduce
Drupal 8 + url function is depreciated see https://www.drupal.org/node/2346779
- Using the soundcloud field
- Set the display format Default PHP-based
- view the node
Proposed resolution
Update the function call to use the new method ie Url::fromUri
Issue fork soundcloudfield-3244862
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
akoepke CreditAttribution: akoepke commentedThanks for the change, forgot to modify that line when moving changes between versions of the module.
I also fixed up my array syntax on that same line, should have been using the short syntax.