From bd78cefa3eb8725bd8dce932901f3ac25becb643 Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 7 Aug 2024 09:03:22 +0200 Subject: [PATCH] fix not displayed images in tree in admin, as they already contained an absolute path or full url --- api/js/etemplate/Et2Tree/Et2Tree.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Tree/Et2Tree.ts b/api/js/etemplate/Et2Tree/Et2Tree.ts index 5984e2264c..f7489061e8 100644 --- a/api/js/etemplate/Et2Tree/Et2Tree.ts +++ b/api/js/etemplate/Et2Tree/Et2Tree.ts @@ -871,8 +871,8 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin //sl-icon images need to be svgs if there is a png try to find the corresponding svg img = img.replace(".png", ".svg"); } - //append image path if it was not set by the server already - if (!img.startsWith(this.imagePath)) + //append image path, if img is only relative (does not start with / or https://) + if (!img.match(/^(\/|https?:\/\/)/)) { img = this.imagePath + img; }