Skip to content

Commit

Permalink
Github issue ec-europa#142: Replace deprecated drupal_get_path().
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Dec 13, 2021
1 parent 24c7ec2 commit ceaae83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rdf_entity.install
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ function rdf_entity_update_8004() {
$extensions_config = $config_factory->get('core.extension');
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
/** @var \Drupal\Core\Extension\ExtensionPathResolver $extension_path_resolver */
$extension_path_resolver = \Drupal::service('extension.path.resolver');
foreach (['mapping', 'graph'] as $type) {
// Install the new entity type definitions.
$entity_type = $entity_type_manager->getDefinition("sparql_$type");
Expand All @@ -118,7 +120,7 @@ function rdf_entity_update_8004() {
foreach (['module', 'theme'] as $extension_type) {
$extensions = array_keys($extensions_config->get($extension_type));
foreach ($extensions as $extension_name) {
$extension_path = drupal_get_path($extension_type, $extension_name);
$extension_path = $extension_path_resolver->getPath($extension_type, $extension_name);
foreach (['install', 'optional'] as $sub_path) {
try {
foreach ($file_system->scanDirectory("$extension_path/config/$sub_path", $file_pattern) as $path => $file) {
Expand Down

0 comments on commit ceaae83

Please sign in to comment.