Skip to content
Snippets Groups Projects
Commit 95046bfc authored by Andrii Sus's avatar Andrii Sus
Browse files

Issue #3369333 by snap_x: Drupal 10 Compatibility

parent f23b46cf
No related branches found
No related tags found
1 merge request!2Issue #3369333 by snap_x: Drupal 10 Compatibility
name: Epub Viewer
type: module
description: 'Field formatter to generate link and read Epub file on browser.'
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.3 || ^10
......@@ -21,7 +21,7 @@ class EpubController {
// Loading file from file ID.
$file = File::load($fid);
$file_uri = $file->getFileUri();
$file_url = Url::fromUri(file_create_url($file_uri));
$file_url = Url::fromUri(\Drupal::service('file_url_generator')->generateAbsoluteString($file_uri));
$data['file_path'] = $file_url->getUri();
$data['base_url'] = $base_url;
$config = \Drupal::config('epub_module.epubsettings');
......@@ -31,7 +31,7 @@ class EpubController {
'font_color' => $config->get('font_color'),
'show_download_icon' => $config->get('show_download_icon'),
];
$module_path = drupal_get_path('module', 'epub_module');
$module_path = \Drupal::service('extension.list.module')->getPath('epub_module');
$data['module_path'] = $base_url . '/' . $module_path;
$build = [
'#theme' => 'epub_view',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment