Problem/Motivation
When trying to export a pricelist you receive an error in the logs complaining about a deprecated api call when using 9.x
Error: Call to undefined method Drupal\Core\File\FileSystem::uriScheme() in commerce_pricelist_file_download() (line 124 of /var/www/sites/drupal9/web/modules/contrib/commerce_pricelist/commerce_pricelist.module)
Steps to reproduce
export a pricelist, review error in error log when using drupal 9.x
Proposed resolution
resolution was to replace the urlScheme call with
use Drupal\Core\StreamWrapper\StreamWrapperManager;
replace:
$scheme = \Drupal::service('file_system')->uriScheme($uri);
with:
$scheme = StreamWrapperManager::getScheme($uri);
Remaining tasks
Problem remaining is what to do with earlier versions, which still have the api call. Ie anything earlier than 9.x will work as expected, so not sure what is the best course of action here, other than a new release version only compatible with 9.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | 3182773-2.patch | 1.44 KB | jsacksick |
|
Comments
Comment #2
jsacksick CreditAttribution: jsacksick at Centarro commentedI don't really understand why we'd need to release a version only compatible with Drupal 9? The attached patch is fixing the issue for versions > Drupal core 8.8.
Comment #3
DigitalCatalyst CreditAttribution: DigitalCatalyst commentedahh ok, yes bump to 8.8, perfect
Comment #4
jsacksick CreditAttribution: jsacksick at Centarro commentedCommitted!