Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6e8e05e
minimize calls of getRefObj/getLinkObj
drfho Feb 7, 2026
e8eb17b
debug code for call-counting
drfho Feb 7, 2026
7828500
added traceback for debugging
drfho Feb 8, 2026
61f5064
more traceback for debugging
drfho Feb 9, 2026
e1201ac
revoke inline-validation in zmi
drfho Feb 9, 2026
934f173
removed debug output for merge
drfho Feb 9, 2026
f94c041
Merge branch 'main' into fix_redundant_link_processing
drfho Feb 9, 2026
44aff6f
restored lines for debug output
drfho Feb 9, 2026
9481056
call getRefObj for embedded links
zmsdev Feb 10, 2026
f1b0167
call getRefObj for embedded links
zmsdev Feb 10, 2026
307580e
debug-helper: added buffer-counter for getLinkObj
drfho Feb 11, 2026
f6f97fa
Persist embed_type (attr_type)
zmsdev Feb 11, 2026
b87103b
monotonized indents of former commit
drfho Feb 11, 2026
9d69e49
fixed redundant call of getLinkObj
zmsdev Feb 12, 2026
25b6b56
Merge branch 'fix_redundant_link_processing' of https://github.com/zm…
zmsdev Feb 12, 2026
409438b
Merge branch 'main' into fix_redundant_link_processing
drfho Feb 12, 2026
d48572e
Merge branch 'main' into fix_redundant_link_processing
drfho Feb 12, 2026
b880fd5
modified validateLinkObj description
drfho Feb 13, 2026
7d6faad
embed remote objects and prepare impoved validation of ref-objects
zmsdev Feb 13, 2026
f8f06d1
prepare for merge
drfho Feb 18, 2026
bef6f77
restore debug code
drfho Feb 18, 2026
ca3b922
refact conditionioning link-validation
drfho Feb 18, 2026
51ff4b4
Merge branch 'main' into fix_redundant_link_processing
drfho Feb 18, 2026
a6bfe6a
Merge branch 'main' into fix_redundant_link_processing
drfho Feb 23, 2026
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
2 changes: 1 addition & 1 deletion Products/zms/_cachemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def clearReqBuff(self, prefix='', REQUEST=None):
def fetchReqBuff(self, key=None, REQUEST=None):
request = getattr(self, 'REQUEST', getRequest())
if key is None: # For debugging purposes, return whole buffer.
return None # request.get('__buff__',{})
return request.get('__buff__',{})
buff = request['__buff__']
reqBuffId = self.getReqBuffId(key)
return getattr(buff, reqBuffId)
Expand Down
28 changes: 27 additions & 1 deletion Products/zms/_zreferableitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
# Product Imports.
from Products.zms import standard
from zope.globalrequest import getRequest

# FOR DEBUGGING PURPOSES ONLY: import traceback to log the call stack of getLinkObj calls
import traceback

# ------------------------------------------------------------------------------
# isMailLink:
Expand Down Expand Up @@ -497,6 +498,7 @@ def findObject(self, url):
# ----------------------------------------------------------------------------
def getLinkObj(self, url, REQUEST=None):
request = getattr(self, 'REQUEST', getRequest())
was_buffered = True
ob = None
if isInternalLink(url):
# Params.
Expand All @@ -516,6 +518,7 @@ def getLinkObj(self, url, REQUEST=None):
try:
ob = self.getDocumentElement().fetchReqBuff(reqBuffId)
except:
was_buffered = False
if url.find('id:') >= 0:
catalog = self.getZMSIndex().get_catalog()
q = catalog({'get_uid':url})
Expand Down Expand Up @@ -543,6 +546,29 @@ def getLinkObj(self, url, REQUEST=None):
ids = self.getPhysicalPath()
if ob.id not in ids:
ob.set_request_context(request, ref_params)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# DEBUG: logging/counting getLinkObj calls
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
request.set('getLinkObj_counter', request.get('getLinkObj_counter', 0) + 1)
# show traceback in debugging output to identify which function is calling getLinkObj and causing multiple calls
traceback_stack = []
for frame in reversed(traceback.extract_stack()[-5:-2]):
traceback_stack.append('%s:%s:%s' % (str(frame.filename).split('/')[-1], frame.lineno, frame.name))
request.set('count_buffered_getLinkObj_calls', request.get('count_buffered_getLinkObj_calls', 0) + int(was_buffered))
standard.writeStdout(self, '%d. [%s:getLinkObj] %s, Target-ID=%s (%s), URL=%s, was_buffered=%s (%s), ref_params=%s\n...was called from:\n\t%s\n'%(
request.get('getLinkObj_counter', 0),
self.meta_id,
url,
ob.id if ob is not None else None,
ob.meta_id if ob is not None else None,
ob.absolute_url(relative=1) if ob is not None else None,
was_buffered,
request.get('count_buffered_getLinkObj_calls', 0),
ref_params,
'\n\t'.join(traceback_stack)
)
)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
return ob


Expand Down