Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemtagsplugin.js generates empty ghost system tags. #39983

Closed
rotdrop opened this issue Aug 21, 2023 · 1 comment
Closed

systemtagsplugin.js generates empty ghost system tags. #39983

rotdrop opened this issue Aug 21, 2023 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap feature: tags technical debt

Comments

@rotdrop
Copy link
Contributor

rotdrop commented Aug 21, 2023

The following piece of code probably doesn't do what was expected if the systemTags data attribute is there but empty:

var fileInfo = oldElementToFile.apply(this, arguments);
var systemTags = $el.attr('data-systemTags');
fileInfo.systemTags = systemTags?.split?.('|') || [];

The following happens

  1. systemTags variable will be the empty string
  2. systemTags?.split?.('|') will then happily be executed by the browser, calling the split method on this empty string
  3. according to MDN this results in [ '' ], i.e. an array containing an empty string
  4. later on this will then generate an empty "ghost" system tag in the UI which somehow garbles the file-list

See

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split?retiredLocale=de#using_split

Please note that the same file here

$tr.attr('data-systemTags', systemTags.join('|'));

make sure that the systemTags data attribute is defined.

@szaimen szaimen added 0. Needs triage Pending check for reproducibility or if it fits our roadmap technical debt labels Aug 21, 2023
@joshtrichards
Copy link
Member

joshtrichards commented Aug 30, 2024

No longer applicable. Code has been replaced as of 28 via #40284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap feature: tags technical debt
Projects
None yet
Development

No branches or pull requests

3 participants