Problem/Motivation
There are a couple of deprecated calls, example uriScheme() and getTarget() function calls in the following modules/hooks:
- social_event_enrolments / social_event_enrolments_export_file_download()
- social_group_members / social_group_members_export_file_download()
- social_user_export / social_user_export_file_download()
Some other deprecated calls on:
- social_core.install:572 / theme_handler service
- SocialGroupSecretSubscriber.php:60 / setException()
Steps to reproduce
Download any file from Open Social, or upload a picture, the thumbnail will be broken.
Proposed resolution
Change the deprecated calls from:
$scheme = \Drupal::service('file_system')->uriScheme($uri);
$target = \Drupal::service('stream_wrapper_manager')->getTarget($uri);
to
$scheme = StreamWrapperManager::getScheme($uri);
$target = StreamWrapperManager::getTarget($uri);
Recommendation:
https://git.drupalcode.org/project/drupal/-/blob/8.9.x/core/lib/Drupal/C...
https://git.drupalcode.org/project/drupal/-/blob/8.9.x/core/lib/Drupal/C...
setException @deprecated since Symfony 4.4, use setThrowable instead
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comments
Comment #2
tbsiqueiraComment #3
beatrizrodriguesI'll work on that.
Comment #5
beatrizrodriguesI applied the proposed resolution. Please, review :)
Comment #6
tbsiqueiraComment #7
tbsiqueiraPR: https://github.com/goalgorilla/open_social/pull/2654
Comment #8
andregp commented@tbsiqueira, I could not find any documentation on theme_handler service or RequestEvent::setException() being deprecated. Do you have any link?
Comment #9
beatrizrodriguesComment #10
beatrizrodriguesPlease, review. I hope it fits.
Comment #11
tbsiqueiraThank you very much for your work @beatrizrodrigues!
Very good questions @andregp!
I found the deprecation while checking our code with phpStan. Upon diving a bit on the Drupal source files, I found this at the "theme_handler": https://git.drupalcode.org/project/drupal/-/blob/8.9.x/core/lib/Drupal/C...
For
setException()I followed the method implemented atvendor/symfony/http-kernel/Event/GetResponseForExceptionEvent.phpthat has a comment that this method is deprecated from Symfony 4.4.Please let me know if this answer your question!
Kind regards.
Comment #13
tbsiqueira