Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 27 additions & 19 deletions Products/zms/_zreferableitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,30 +502,38 @@ def getLinkObj(self, url, REQUEST=None):
i = max(url.find('#'),url.find(','))
if i > 0:
url = url[:i]
if url.find('id:') >= 0:
catalog = self.getZMSIndex().get_catalog()
q = catalog({'get_uid':url})
for r in q:
path = '%s/'%r['getPath']
#-- [ReqBuff]: Fetch buffered value from Http-Request.
reqBuffId = 'getLinkObj.%s'%url
try:
ob = self.getDocumentElement().fetchReqBuff(reqBuffId)
except:
if url.find('id:') >= 0:
catalog = self.getZMSIndex().get_catalog()
q = catalog({'get_uid':url})
for r in q:
path = '%s/'%r['getPath']
l = [x for x in path.split('/') if x]
ob = self.getRootElement()
if l:
[l.pop(0) for x in ob.getPhysicalPath() if l[0] == x]
for id in l:
ob = getattr(ob,id,None)
break
elif not url.startswith('__'):
path = url.replace('@','/content/')
l = [x for x in path.split('/') if x]
ob = self.getRootElement()
ob = self.getDocumentElement()
if l:
[l.pop(0) for x in ob.getPhysicalPath() if l[0] == x]
for id in l:
ob = getattr(ob,id,None)
break
elif not url.startswith('__'):
path = url.replace('@','/content/')
l = [x for x in path.split('/') if x]
ob = self.getDocumentElement()
if l:
[l.pop(0) for x in ob.getPhysicalPath() if l[0] == x]
for id in l:
ob = getattr(ob,id,None)
# Prepare request
ids = self.getPhysicalPath()
if ob is not None and ob.id not in ids:
ob.set_request_context(request, ref_params)
#-- [ReqBuff]: Store value in buffer of Http-Request.
self.getDocumentElement().storeReqBuff(reqBuffId, ob)
# Prepare request (only if ref_params are provided)
if ob is not None and ref_params:
ids = self.getPhysicalPath()
if ob.id not in ids:
ob.set_request_context(request, ref_params)
return ob


Expand Down
2 changes: 1 addition & 1 deletion Products/zms/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025.9.1+b976ca4
2025.9.1+e1201ac
8 changes: 7 additions & 1 deletion Products/zms/zmslinkelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,18 @@ def getRef(self):
# ZMSLinkElement.getRefObj:
# --------------------------------------------------------------------------
def getRefObj(self):
#-- [ReqBuff]: Fetch buffered value from Http-Request.
docelmnt = self.getDocumentElement()
reqBuffId = 'getRefObj.%s'%self.get_uid()
try: return docelmnt.fetchReqBuff(reqBuffId)
except: pass
ref_obj = self.getLinkObj(self.getRef())
if ref_obj == self:
ref_obj = None
if ref_obj is not None and ref_obj.meta_type == 'ZMSLinkElement':
ref_obj = ref_obj.getRefObj()
return ref_obj
#-- [ReqBuff]: Returns value and stores it in buffer of Http-Request.
return docelmnt.storeReqBuff(reqBuffId, ref_obj)


# --------------------------------------------------------------------------
Expand Down
Loading