Fix adding licence key after removing it from marketplace (#5883)

This commit is contained in:
Yuriy Bakhtin 2022-10-04 14:42:17 +03:00 committed by GitHub
parent 6d80b45658
commit 3209014db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,7 @@ HumHub Changelog
- Fix #5856: Fix SMTPS Config Migration - Fix #5856: Fix SMTPS Config Migration
- Fix #5854: Don't validate user language on approve - Fix #5854: Don't validate user language on approve
- Fix #5875: LDAP user creation broken without email address - 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) 1.12.1 (August 15, 2022)

View File

@ -22,6 +22,7 @@ use yii\base\Component;
* @property-read bool $isThirdParty * @property-read bool $isThirdParty
* @property-read bool $isPartner * @property-read bool $isPartner
* @property-read bool $isDeprecated * @property-read bool $isDeprecated
* @property-read bool $isNonFree
* @property-read array $categories * @property-read array $categories
* *
* @author Lucas Bartholemy <lucas@bartholemy.com> * @author Lucas Bartholemy <lucas@bartholemy.com>
@ -134,4 +135,9 @@ class OnlineModule extends Component
{ {
return (bool) $this->info('isDeprecated'); return (bool) $this->info('isDeprecated');
} }
public function getIsNonFree(): bool
{
return $this->info('purchased') || $this->info('price_eur') || $this->info('price_request_quote');
}
} }

View File

@ -133,7 +133,7 @@ class ModuleControls extends Menu
} }
$onlineModule = new OnlineModule(['module' => $this->module]); $onlineModule = new OnlineModule(['module' => $this->module]);
if ($onlineModule->info('purchased')) { if ($onlineModule->isNonFree) {
$this->addEntry(new MenuLink([ $this->addEntry(new MenuLink([
'id' => 'marketplace-licence-key', 'id' => 'marketplace-licence-key',
'label' => Yii::t('AdminModule.base', 'Add Licence Key'), 'label' => Yii::t('AdminModule.base', 'Add Licence Key'),