Skip to content

#4894 [Menu] fix: don't expand the tree branch of the URL id on non-element pages#4895

Merged
nicolas-eoxia merged 1 commit into
Evarisk:developfrom
nicolas-eoxia:fix/4894-tree-id-guard
Jul 6, 2026
Merged

#4894 [Menu] fix: don't expand the tree branch of the URL id on non-element pages#4895
nicolas-eoxia merged 1 commit into
Evarisk:developfrom
nicolas-eoxia:fix/4894-tree-id-guard

Conversation

@nicolas-eoxia

Copy link
Copy Markdown
Contributor

Closes #4894

Problème

Le JS inline de digirisk_header faisait $idToFetch = GETPOSTINT('id')fetch()getBranch() pour déplier la branche de l'élément courant. Sur une page où id désigne un autre objet (fiche standard ?id=3), il dépliait à tort l'élément 3.

Fix

Ne calculer $idToFetch que si $_SERVER['PHP_SELF'] est une page élément/accident (sinon 0 → pas de fetch, pas de dépliage).

Résultat mesuré (élément 3 = WU1, parent GP1)

Fiche standard ?id=3 : arbre replié (0 nœud toggled), identique à l'arrivée par le menu ✅. Page élément ?id=3 : élément surligné + branche dépliée, préservé ✅. Vérifié Playwright + capture.

Va avec la PR Saturne Evarisk/Saturne#1447 (les deux sources de la confusion).

🤖 Generated with Claude Code

…n non-element pages

digirisk_header inline JS read GETPOSTINT('id') to fetch the element and expand
its branch. On pages where "id" is another object (e.g. the standard card), it
wrongly expanded the element sharing that id. Only compute idToFetch on the
element/accident pages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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