dashorst opened a new issue, #1951: URL: https://github.com/apache/wicket/issues/1951
In development mode, `DefaultMarkupIdGenerator` builds a markup id from the component id followed by a hexadecimal sequence number, with nothing in between. Repeater children have numeric component ids, so two different components can get the same markup id. For example component id `1` with sequence `0x1a` gives `11a`, and component id `11` with sequence `0xa` gives `11a` too; both become `id11a`. Duplicate ids break Ajax updates (the wrong element is replaced) and accessibility checks. ## Where `wicket-core/src/main/java/org/apache/wicket/DefaultMarkupIdGenerator.java`, method `generateMarkupId`: `markupIdPrefix + markupIdPostfix`. Note that underscores are escaped (`_` becomes `__`) *after* the two parts are joined, so a separator has to survive that escaping and still be unambiguous. ## Done when - Two components with different sequence numbers never get the same markup id in development mode. Production (deployment) mode, which uses `id` as the prefix, is unchanged. - A test that reproduces the collision, in `wicket-core-tests/src/test/java/org/apache/wicket/`. - Existing tests in `wicket-core-tests` and other modules that compare rendered pages against expected HTML files may contain development-mode ids and need updating. Run the full build to find them, and mention in the pull request which expected files changed and why. ## Background Originally reported as [WICKET-7114](https://issues.apache.org/jira/browse/WICKET-7114) (Wicket 8.15, 9.17, 10.1). The Jira ticket has a table of colliding ids. The reporter agreed to a pull request but worried about tests that compare markup ids. --- Part of #1945. This issue is meant for a first contribution to Wicket. To work on it, leave a comment so others know; a claim without a pull request lapses after two weeks. Questions are welcome, here on the issue or on [email protected]. Start your branch from `master`, and see [Send a pull request to Wicket](https://wicket.apache.org/contribute/wicket-pull-request.html) for building and testing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
