Skip to content

TypeError in PageTree.preselect when clicking on file in files field #7747

@medienbaecker

Description

@medienbaecker

Description

When clicking on a file that belongs to a different page in a files field, the Panel throws a JavaScript error (Cannot read properties of undefined (reading '0')) after navigating to this file.

It looks like the error comes from panel/src/components/Navigation/PageTree.vue, line 105 in the preselect method.

Expected behavior
The page loads and displays correctly and the error can be dismissed. I don't understand the full code and what the preselect function is supposed to do here.

To reproduce

  1. Create a files field that queries files from a different place (e.g. site.files)
  2. Select a file
  3. Click on the selected file

Your setup

Kirby Version
5.2.0-rc.1

Console output

TypeError: Cannot read properties of undefined (reading '0')
    at i.preselect (index.min.js:2:287231)

Your system (please complete the following information)

  • OS: macOS 26.1
  • Browser: Chrome
  • Version: 143.0.7499.41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions