Skip to content

Commit 51fbe0e

Browse files
committed
fix: wrong identifier used when pulling and checking plugins failing validation.
1 parent 8a6dddf commit 51fbe0e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/Domain/Plugins/Models/InstalledPlugin.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class InstalledPlugin implements PluginDisplayStrategy
4545

4646
public ?string $calculatedMonthlyPrice;
4747

48+
public ?string $identifier;
49+
4850
public function getCardDesc(): string
4951
{
5052
return $this->description ??= '';
@@ -157,6 +159,17 @@ public function getType(): string
157159

158160
public function getIdentifier(): string
159161
{
160-
return Str::replace('/', '_', Str::lower($this->name));
162+
if(isset($this->identifier) && $this->identifier !== null && $this->identifier !== '') {
163+
return $this->identifier;
164+
}
165+
166+
// There are circumstances where name needs to be used. The root cause has been fixed and identifier should
167+
// be set most of the time however in rare circumstances we need to make sure the name is built correctly
168+
$name = Str::replace('/', '_', Str::lower($this->name));
169+
if(Str::contains($name, '_') === false) {
170+
$name = "leantime_".$name;
171+
}
172+
173+
return $name;
161174
}
162175
}

0 commit comments

Comments
 (0)