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

CommentFileSizeAuthor
#2 3182773-2.patch1.44 KBjsacksick
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DigitalCatalyst created an issue. See original summary.

jsacksick’s picture

Status: Active » Needs review
FileSize
1.44 KB

I 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.

DigitalCatalyst’s picture

ahh ok, yes bump to 8.8, perfect

jsacksick’s picture

Status: Needs review » Fixed

Committed!

  • jsacksick committed dc24146 on 8.x-2.x
    Issue #3182773 by DigitalCatalyst, jsacksick: Fix D8 deprecations and D9...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.