Skip to content

Commit

Permalink
Merge pull request #21852 from demeritcowboy/extension-name
Browse files Browse the repository at this point in the history
dev/core#2876 - When installing an extension that has requirements, show the name not the key
  • Loading branch information
eileenmcnaughton authored Oct 18, 2021
2 parents 2670f1f + 795b276 commit 2fa5a83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRM/Extension/Downloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ public function checkRequirements($extensionInfo = NULL) {
$requiredExtensions = CRM_Extension_System::singleton()->getManager()->findInstallRequirements([$extensionInfo->key], $extensionInfo);
foreach ($requiredExtensions as $extension) {
if (CRM_Extension_System::singleton()->getManager()->getStatus($extension) !== CRM_Extension_Manager::STATUS_INSTALLED && $extension !== $extensionInfo->key) {
$requiredExtensionInfo = CRM_Extension_System::singleton()->getBrowser()->getExtension($extension);
$requiredExtensionInfoName = empty($requiredExtensionInfo->name) ? $extension : $requiredExtensionInfo->name;
$errors[] = [
'title' => ts('Missing Requirement: %1', [1 => $extension]),
'message' => ts('You will not be able to install/upgrade %1 until you have installed the %2 extension.', [1 => $extensionInfo->key, 2 => $extension]),
'message' => ts('You will not be able to install/upgrade %1 until you have installed the %2 extension.', [1 => $extensionInfo->name, 2 => $requiredExtensionInfoName]),
];
}
}
Expand Down

0 comments on commit 2fa5a83

Please sign in to comment.