fix(templates): deduplicate provider templates

Signed-off-by: Elizabeth Danzberger <elizabeth@elzody.dev>
pull/56722/head
Elizabeth Danzberger 2025-11-26 13:08:08 +07:00
parent 186b12b718
commit 3a89c18888
No known key found for this signature in database
GPG Key ID: 6B466A21DF5E753C
1 changed files with 3 additions and 2 deletions

@ -213,12 +213,13 @@ class TemplateManager implements ITemplateManager {
foreach ($this->getRegisteredProviders() as $provider) {
foreach ($type->getMimetypes() as $mimetype) {
foreach ($provider->getCustomTemplates($mimetype) as $template) {
$templates[] = $template;
$templateId = $template->jsonSerialize()['templateId'];
$templates[$templateId] = $template;
}
}
}
return $templates;
return array_values($templates);
}
/**