Problem/Motivation

The threads are always outputed inside a div with an ID like private-message-thread-<n>.
Here is the code:
https://git.drupalcode.org/project/private_message/-/blob/3.0.2/src/Enti...

A common usage of Private Message is to display a thread with the Inbox in a side bar. In this case, the HTML page will have two divs with the same ID, which is not correct.

Steps to reproduce

Display the Inbox block in a side bar, create a thread and check the HTML of the thread's page.

Proposed resolution

My proposal is to remove the ID of the thread when it's not the full view (meaning, the threads in Inbox won't have it).
AFAIK we are using the attribute "data-thread-id" for any JS manipulation, so I don't think this will have any impact.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dxvargas created an issue. See original summary.

sourabhsisodia_’s picture

Assigned: Unassigned » sourabhsisodia_

sourabhsisodia_’s picture

Assigned: sourabhsisodia_ » Unassigned
Status: Active » Needs review
claudiu.cristea’s picture

Status: Needs review » Needs work

It seems that the MR is breaking the tests (or even JS functionality?)

alorenc made their first commit to this issue’s fork.

alorenc’s picture

Status: Needs work » Needs review
claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for reporting and fixing.

herved’s picture

+1, looks ok to me
Maybe the scope of #3488097: Remove private-message-* id could have been combined here, but it's fine either way.

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.