There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e1b6fbd9-5914-4ade-ac8b-ddde1dd2b812 XWIKI-18921 Reopened

Panel Navigation: duplicated IDs

 
View issue   ·   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-16e925ac-59a5-41ca-9088-b6750cbc7627 Marius Dumitru Florea on 10/Sep/26 15:30
 
[~Lucas C] it looks like you missed a place where tree nodes are created. While investigating CKEditor's LinkIT#createLinkForNotExistingPage Claude found this:

{noformat}
I have a solid diagnosis. Let me lay it out while the agents finish.

createLinkForNotExistingPage — root cause (independent of my change)

3c08afa2004 (XWIKI-18921, Sep 9 12:12) made every tree node's rendered anchor id unique by prefixing it with the tree container's id: <treeId>-<nodeId>_anchor instead of <nodeId>_anchor. It applies that prefix in exactly two places in tree.js — the getChildren callback (server-fetched nodes) and the create_node call inside openTo (nodes past pagination) — and updated TreeElement/TreeNodeElement to match.

It missed a third node-creation path: entityResourcePicker.js:122, where the link picker's own "create page" flow calls tree.create_node(parentNode, createdNode, 'last', null) with a node spec that has no a_attr.id. So a page created through the link dialog's tree still renders an unprefixed anchor id, while TreeElement.getRenderedAnchorId now builds the prefixed one. LinkTreeElement.createNode → openTo → waitForNodeSelected therefore never matches, and times out.

Two consequences worth separating:

* The test failure is a real signal, not a flicker.
* It's also a product bug: XWIKI-18921's goal was page-wide-unique anchor ids, and nodes created via the picker still get unprefixed ones — so the duplicate-id problem it set out to fix persists on that path. The right fix is in tree.js (one place that prefixes any created node), not at the call site.

{noformat}