diff --git a/CHANGELOG.md b/CHANGELOG.md index f267a1425e..1f794040f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ HumHub Changelog - Fix #5856: Fix SMTPS Config Migration - Fix #5854: Don't validate user language on approve - Fix #5875: LDAP user creation broken without email address +- Fix #5874: Fix adding licence key after removing it from marketplace 1.12.1 (August 15, 2022) diff --git a/protected/humhub/components/OnlineModule.php b/protected/humhub/components/OnlineModule.php index 91be22cbb1..c50b1bc8e3 100644 --- a/protected/humhub/components/OnlineModule.php +++ b/protected/humhub/components/OnlineModule.php @@ -22,6 +22,7 @@ use yii\base\Component; * @property-read bool $isThirdParty * @property-read bool $isPartner * @property-read bool $isDeprecated + * @property-read bool $isNonFree * @property-read array $categories * * @author Lucas Bartholemy @@ -134,4 +135,9 @@ class OnlineModule extends Component { return (bool) $this->info('isDeprecated'); } + + public function getIsNonFree(): bool + { + return $this->info('purchased') || $this->info('price_eur') || $this->info('price_request_quote'); + } } diff --git a/protected/humhub/modules/admin/widgets/ModuleControls.php b/protected/humhub/modules/admin/widgets/ModuleControls.php index 2be146f3c0..eac20d047d 100644 --- a/protected/humhub/modules/admin/widgets/ModuleControls.php +++ b/protected/humhub/modules/admin/widgets/ModuleControls.php @@ -133,7 +133,7 @@ class ModuleControls extends Menu } $onlineModule = new OnlineModule(['module' => $this->module]); - if ($onlineModule->info('purchased')) { + if ($onlineModule->isNonFree) { $this->addEntry(new MenuLink([ 'id' => 'marketplace-licence-key', 'label' => Yii::t('AdminModule.base', 'Add Licence Key'),