Closed Bug 1741603 Opened 6 months ago Closed 2 months ago

Uncaught TypeError: this._view.parentElement is undefined errors in browser console when selecting Show in Folder context menu option from App Menu-> Bookmarks

Categories

(Firefox :: Bookmarks & History, defect, P3)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
100 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox94 --- unaffected
firefox95 --- wontfix
firefox96 --- wontfix
firefox100 --- verified

People

(Reporter: atrif, Assigned: lebar)

References

Details

Attachments

(3 files)

Attached image bookmark_00.gif

Affected versions

  • 96.0a1 (20211116212601)
  • 95.0b8 (20211116185800)

Affected platforms

  • macOS 10.15
  • Windows 10x64
  • Ubuntu 16.04

Steps to reproduce

  1. Open Firefox browser console.
  2. Open App Menu-> Bookmarks and r-click on a random bookmark.
  3. Select Show in Folder and observe the browser console.

Expected result

  • No errors are displayed. (I don’t know if something else should happen here)

Actual result

  • Two errors are displayed inside the browser console.

Regression range

  • I don’t think this is a regression. This was added with implementation with bug 469441.

Notes

  • Attached a screen recording.
Has STR: --- → yes

I think that the problem is with buildContextMenu in controller.js (https://searchfox.org/mozilla-central/rev/1e5b6b30d96e9bd7d63eb22bda6f43cf212b5819/browser/components/places/content/controller.js#594-598). The relevant lines are below. This menu item should not even be available in a non-search context. Not sure why it is getting past nodeIsQuery()

let hideIfNotSearch =
  item.getAttribute("hide-if-not-search") == "true" &&
  (!this._view.selectedNode ||
    !this._view.selectedNode.parent ||
    !PlacesUtils.nodeIsQuery(this._view.selectedNode.parent));

There are no real side effects to this, though. But the menu item just doesn't make sense in this context. Anyway, I just thought I'd take a preliminary look at it. It's for :mak to weigh in.

I think it may actually be useful, as an option. It's true that is not a "search terms" query, but it's still a visualization where there's no folders hierarchy, so a user may be interested into going from this "recent bookmarks" list, to the actual folder containing this bookmark.

So, I'd rather vote to fix the feature, that probably means fixing the view to point to the appropriate Places view object, or fix parentElement for this specific view. Not sure, it should be investigated, but it can be fixed.

Priority: -- → P3
Depends on: 469441
See Also: 469441
Assignee: nobody → lebar
Status: NEW → ASSIGNED
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c09df30d2249
Fix Show in Folder context menu item in app menu to open in sidebar. r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
Regressions: 1759751
Flags: qe-verify+

Verified fixed with Firefox 100.0b7 (20220417185951) on Windows 10x64, macOS 10.15 and Ubuntu 21.04. Clicking Show in Folder context menu option inside App Menu > Bookmarks opens the sidebar with the bookmark focused and no errors are displayed inside the browser console.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.