If an issue and one of its comments shares the same internal ID, then Gitea generates a duplicated html id in the issue view #9901

Closed
opened 2025-11-02 08:52:40 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @fsologureng on GitHub (Nov 28, 2022).

Description

When a new Gitea instance is recently created, the first issue created and its, eventually, first comment (for example when the first instance comment goes to the first instance issue) shares the same internal ID, then the HTML created to that issue keeps a duplicated html ID for both objects.

this hidden element id collisionate with the id of this another hidden element generated here. The former is the raw content of the issue and the latter the raw content of the comment. This situation only occurs if both the issue and the comment internal ID shares the same page. In others words, if a comment shares the same internal ID with their issue, situation common with new issues over new instances.

Screenshots

image

image

image

Gitea Version

1.19.0+dev-112-g6fb168141

Can you reproduce the bug on the Gitea demo site?

No

Operating System

No response

Browser Version

Firefox 107.0

Originally created by @fsologureng on GitHub (Nov 28, 2022). ### Description When a new Gitea instance is recently created, the first issue created and its, eventually, first comment (for example when the first instance comment goes to the first instance issue) shares the same internal ID, then the HTML created to that issue keeps a duplicated html ID for both objects. [this hidden element](https://github.com/go-gitea/gitea/blob/main/templates/repo/issue/view_content.tmpl#L80) id collisionate with the id of this another hidden element [generated here](https://github.com/go-gitea/gitea/blob/main/templates/repo/issue/view_content/comments.tmpl#L80). The former is the raw content of the issue and the latter the raw content of the comment. This situation only occurs if both the issue and the comment internal ID shares the same page. In others words, if a comment shares the same internal ID with their issue, situation common with new issues over new instances. ### Screenshots ![image](https://user-images.githubusercontent.com/5055343/204405422-26009d9a-169d-49f7-b055-a8b9e0315d21.png) ![image](https://user-images.githubusercontent.com/5055343/204405489-88368fcd-92a7-4045-94c1-086a9b840e82.png) ![image](https://user-images.githubusercontent.com/5055343/204405577-c66ecb40-9a58-4773-9e38-d227ed465ccc.png) ### Gitea Version 1.19.0+dev-112-g6fb168141 ### Can you reproduce the bug on the Gitea demo site? No ### Operating System _No response_ ### Browser Version Firefox 107.0
GiteaMirror added the topic/uitype/bug labels 2025-11-02 08:52:40 -06:00
Author
Owner

@fsologureng commented on GitHub (Dec 7, 2022):

Here is an example of the bug: if you do "Quote reply" to the linked comment (2nd in the list), you will got the text of the issue itself (first comment in the list) as quote in the editor.

@fsologureng commented on GitHub (Dec 7, 2022): [Here](https://codeberg.org/Codeberg/Community/issues/1#issuecomment-1) is an example of the bug: if you do "Quote reply" to the linked comment (2nd in the list), you will got the text of the issue itself (first comment in the list) as quote in the editor.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9901