Skip to content

Commit 0000568

Browse files
committed
fix(templates): deduplicate provider templates
Signed-off-by: Elizabeth Danzberger <[email protected]>
1 parent 28a735d commit 0000568

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/private/Files/Template/TemplateManager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,13 @@ private function getProviderTemplates(TemplateFileCreator $type): array {
223223
foreach ($this->getRegisteredProviders() as $provider) {
224224
foreach ($type->getMimetypes() as $mimetype) {
225225
foreach ($provider->getCustomTemplates($mimetype) as $template) {
226-
$templates[] = $template;
226+
$templateId = $template->jsonSerialize()['templateId'];
227+
$templates[$templateId] = $template;
227228
}
228229
}
229230
}
230231

231-
return $templates;
232+
return array_values($templates);
232233
}
233234

234235
/**

0 commit comments

Comments
 (0)