Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fx for deprecation Calling InfoParserDynamic::__construct() without the $app_root argument is deprecated in drupal:10.1.0 #467

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions apigee_m10n.module
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,16 @@ function apigee_m10n_form_user_admin_permissions_alter(&$form, FormStateInterfac
* Implements hook_apigee_edge_user_agent_string_alter().
*/
function apigee_m10n_apigee_edge_user_agent_string_alter(&$user_agent_parts) {
$infoParser = new InfoParser();
$m10_module_info = $infoParser->parse(\Drupal::service('module_handler')->getModule('apigee_m10n')->getPathname());
$app_root = \Drupal::hasService('kernel') ? \Drupal::root() : DRUPAL_ROOT;
$infoParser = new InfoParser($app_root);
$m10_module_info = $infoParser->parse(\Drupal::service('module_handler')->getModule('apigee_m10n')->getPathname());

if (!isset($m10_module_info['version'])) {
$m10_module_info['version'] = '2.x-dev';
}
if (!isset($m10_module_info['version'])) {
$m10_module_info['version'] = '2.x-dev';
}

// m10 module info at beginning of the array.
array_unshift($user_agent_parts , $m10_module_info['name'] . '/' . $m10_module_info['version']);
// m10 module info at beginning of the array.
array_unshift($user_agent_parts , $m10_module_info['name'] . '/' . $m10_module_info['version']);
}

/**
Expand Down