Skip to content

getHref2Html: Avoid Recursion on Odd-Parent Traversal - #509

Draft
drfho wants to merge 1 commit into
mainfrom
resilient_traversal_for_etHref2Html
Draft

drfho wants to merge 1 commit into
mainfrom
resilient_traversal_for_etHref2Html

Conversation

@drfho

@drfho drfho commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Ref: #508

When ZMSObjectSet lists ZMSTextarea the link creation may end in a recursion (due to self.getPhysicalPath()[2:]), because parent does not provide the needed attributes.
To make getHref2Html() resilient aganist the acquisition edge cases, there is a new parameter "resilient" that can be used explictly or is implicitly used as a fallback: resilient=False is the default and this down-compatible:

ZMS/Products/zms/zmsobject.py

Lines 1090 to 1098 in 4815bbe

if not self.isPage():
if not resilient:
try:
parent = self.getParentNode()
pageext = parent.getPageExt(REQUEST)
href = parent.getHref2Html(fct, pageext, REQUEST, resilient=False)
if href.find('#') > 0:
href = href[:href.find('#')]
href += '#' + self.id

ZMSObjectSet6

@drfho
drfho requested a review from zmsdev July 29, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant