Skip to content

Commit

Permalink
Fx for deprecation InfoParserDynamic without argument (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
divya-intelli authored Nov 3, 2023
1 parent 1f2f01c commit b282a8f
Showing 1 changed file with 8 additions and 7 deletions.
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

0 comments on commit b282a8f

Please sign in to comment.