From a64ceb4076540a988834bbe082b3c5ec8647d91d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 9 Jun 2020 08:01:38 +0200
Subject: [PATCH] web: fix refered object extractions when page is in context
 of web site

Base_extractReferredObjectDictFromHtml except that base url to have a
leading /, because we ignore the first character of the normalized URL
returned by Base_normalizeUrlPathname.

By using / as base URL when we are in the context of the website, the
paths passed to Base_normalizeUrlPathname always start by / so we can
safely drop / from the normalized path returned by
Base_normalizeUrlPathname
---
 .../erp5_web/Base_extractReferredObjectDictFromHtml.py          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_extractReferredObjectDictFromHtml.py b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_extractReferredObjectDictFromHtml.py
index c29d33b7ff..9d65672b7a 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_extractReferredObjectDictFromHtml.py
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_extractReferredObjectDictFromHtml.py
@@ -122,7 +122,7 @@ else:
   root_url = base_url_root_object.absolute_url()
   base_url = base_url_object.absolute_url()
 
-base_path = "."
+base_path = "/"
 if base_url_object.getRelativeUrl().startswith(base_url_root_object.getRelativeUrl()):
   base_path = base_url_object.getRelativeUrl()[len(base_url_root_object.getRelativeUrl()):]
   if base_path and not base_path.startswith("/"):
-- 
2.30.9