Closed Bug 1333427 Opened 8 years ago Closed 8 years ago

Get console warnings "Empty string passed to getElementById()" during normal operation

Categories

(Tree Management :: Treeherder, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wlach, Assigned: wlach)

References

Details

Attachments

(1 file)

It seems like something about the way we're using the bootstrap menus is triggering a console error (Empty string passed to getElementById) in Firefox whenever the user interacts with the page. Taking out all the dropdown menus fixes the issue (after applying the fix for bug 1333422, which also causes this warning)

Ostensibly this used to be a problem with bootstrap but is now fixed (supposedly): https://github.com/twbs/bootstrap/issues/5566

Swapping things to use Angular bootstrap's dropdown directives also seems to fix the issue, but breaks the "checkbox" (tier, repository) menus. http://angular-ui.github.io/bootstrap/#/dropdown

It's unclear to me what the root cause is here: whether it's bootstrap, angular, or some interaction between the two. I can't really justify spending any more time on this right now, but it would be nice to fix this at some point as the error frequently causes people to misdiagnose problems.
Aha, figured it out. It's the data-target property we're setting on these dropdowns that's causing the problems, since it makes bootstrap look for "#" as a selector. If we remove this useless property, our problems go away.
Attachment #8829898 - Flags: review?(james)
Attachment #8829898 - Flags: review?(james) → review+
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/7621f2419d4a37ca4721a685bff5e5f4c55f61ba
Bug 1333427 - Fix remaining "Empty string passed to getElementById()" warnings (#2100)

It turns out that adding a data-target property of '#' to a dropdown
is unnecessary and confuses bootstrap.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Assignee: nobody → wlachance

(In reply to Treeherder GitHub Bugbot from comment #3)

Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/
7621f2419d4a37ca4721a685bff5e5f4c55f61ba
Bug 1333427 - Fix remaining "Empty string passed to getElementById()"
warnings (#2100)

It turns out that adding a data-target property of '#' to a dropdown
is unnecessary and confuses bootstrap.

Because dropdown don't have ID's data-target in bootstarp 3

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: