From 6d9cbf06be449e8b3018863eb6eae108c2e3ea47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= <cedric.dsm@tiolive.com> Date: Mon, 20 Oct 2014 13:14:39 +0000 Subject: [PATCH] erp5_hal_json_style: check if isWebMode is present before calling it. (cherry picked from commit ee7cb2097c4da4bf9a0a7afca1ff2726aa92b2ef) --- .../erp5_hal_json_style/ERP5Document_getHateoas.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml b/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml index eec61276d5..12574f3028 100644 --- a/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml +++ b/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml @@ -341,7 +341,8 @@ portal = context.getPortalObject()\n sql_catalog = portal.portal_catalog.getSQLCatalog()\n \n # Calculate the site root to prevent unexpected browsing\n -is_web_mode = (context.REQUEST.get(\'current_web_section\', None) is not None) or context.isWebMode()\n +is_web_mode = (context.REQUEST.get(\'current_web_section\', None) is not None) or (hasattr(context, \'isWebMode\') and context.isWebMode())\n + # is_web_mode = traversed_document.isWebMode()\n if is_web_mode:\n site_root = context.getWebSectionValue()\n -- GitLab