From f9bad8c8f1402c42360b18052beaa5f616a88583 Mon Sep 17 00:00:00 2001 From: "Austin M. Matherne" Date: Fri, 6 Mar 2026 10:48:57 -0500 Subject: [PATCH] Fix mappedPaths registration lost between webserver requests DisclosureSystem.select() clears mappedPaths on each request, so the __xule_resources_dir__ mapping registered once in init() was lost after the first request. Move the registration outside the once-only guard so it re-registers on every call, with a duplicate check for idempotency. --- validate/XuleInterface.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/validate/XuleInterface.py b/validate/XuleInterface.py index 649ce63f..92a2b61f 100644 --- a/validate/XuleInterface.py +++ b/validate/XuleInterface.py @@ -77,10 +77,11 @@ def init(cntlr): global xuleValidateFinally if xuleValidateFinally is None: xuleValidateFinally = getXuleMethod(cntlr, 'Validate.Finally') - if xuleValidateFinally is not None: # xule is loaded - # add EDGAR mapping for resource files to disclosureSystem.mappings - if cntlr.modelManager.disclosureSystem: - mappedPath = f"{os.sep}__xule_resources_dir__" + if xuleValidateFinally is not None: # xule is loaded + # add EDGAR mapping for resource files to disclosureSystem.mappings (re-register each call; DisclosureSystem.select() clears mappedPaths) + if cntlr.modelManager.disclosureSystem: + mappedPath = f"{os.sep}__xule_resources_dir__" + if (mappedPath, _xule_resources_dir) not in cntlr.modelManager.disclosureSystem.mappedPaths: cntlr.modelManager.disclosureSystem.mappedPaths.append((mappedPath, _xule_resources_dir)) normalizedMappedPath = cntlr.webCache.normalizeUrl(mappedPath,None) # normalization occurs within ModelDocument.load() if normalizedMappedPath != mappedPath: # python 3.13 on Windows also needs to map with drive letter added