NUKnightLab / NUKnightLab/TimelineJS3

TwitterEmbed mediatype incorrectly assumes there is only one element with className tl-media-twitter

Open
#896 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.2k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

This must have been around for a long time, but I stumbled onto this bug which is visible using the "all media types" configuration using the local test server (npm start)

https://github.com/NUKnightLab/TimelineJS3/blob/e904ae99fcc7e0275982a2ea0b012dee95edeed4/src/js/media/types/TwitterEmbed.js#L80

Probably the fix is to add a unique ID when the media DOM elements are created and use that in the callback instead of just assuming index there's only one.

But except for backwards compatibility is this something that affects many users? probably not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start the local test server with npm start and reproduce the issue using the "all media types" configuration. Read src/js/media/types/TwitterEmbed.js around line 80 and inspect how the media DOM elements are created. Done means multiple elements with className tl-media-twitter each trigger the callback for the correct Twitter embed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.