Skip to content
Snippets Groups Projects
Commit 91cdbb9e authored by Yazan Majadba's avatar Yazan Majadba Committed by Rajab Natshah
Browse files

Issue #3391046 by YazanMajadba: Fix with a switch to support Drupal 10...

Issue #3391046 by YazanMajadba: Fix with a switch to support Drupal 10 extension path resolver and file repository services and remove deprecation
parent 5f6d617b
No related branches found
No related tags found
1 merge request!2Issue #3391046 by YazanMajadba: Fix with a switch to support Drupal 10 extension path resolver and file repository services and remove deprecation
......@@ -25,8 +25,8 @@ function varbase_styleguide_page_attachments(array &$page) {
function varbase_styleguide_styleguide_alter(&$items) {
// Change the styleguide-preview.jpg with flag-earth.jpg .
$image_data = file_get_contents(drupal_get_path('module', 'varbase_styleguide') . '/images/flag-earth.jpg');
$file = file_save_data($image_data, 'public://flag-earth.jpg', FileSystemInterface::EXISTS_REPLACE);
$image_data = file_get_contents(\Drupal::service('extension.path.resolver')->getPath('module', 'varbase_styleguide') . '/images/flag-earth.jpg');
$file = \Drupal::service('file.repository')->writeData($image_data, 'public://flag-earth.jpg', FileSystemInterface::EXISTS_REPLACE);
if (isset($image_data) && isset($file)) {
foreach ($items as $item_index => $item) {
......
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