Skip to content

Commit

Permalink
Add reference to the tagGroup so it can be reloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jan 4, 2023
1 parent 9de2476 commit 63c8ea0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected function captureTagFieldInput(PublicationFieldDefinition $field): ?Pub

$this->tip('You can enter multiple tags separated by commas');

$choice = $this->reloadableChoice($this->getReloadableTagValuesArrayClosure(),
$choice = $this->reloadableChoice($this->getReloadableTagValuesArrayClosure($tagGroup),
'Which tag would you like to use?',
'Reload tags.json',
true
Expand Down Expand Up @@ -211,10 +211,10 @@ protected function tip(string $message): void
}

/** @return Closure<array<string>> */
protected function getReloadableTagValuesArrayClosure(): Closure
protected function getReloadableTagValuesArrayClosure(string $tagGroup): Closure
{
return function (): array {
return PublicationService::getValuesForTagName($this->publicationType->getIdentifier())->toArray();
return function () use ($tagGroup): array {
return PublicationService::getValuesForTagName($tagGroup)->toArray();
};
}
}

0 comments on commit 63c8ea0

Please sign in to comment.