Skip to content

Copilot: admin UI startup throws "Cannot read properties of undefined (reading 'length')" for a user without menu entries #697

Open

Description

@laticrete-pimcore

Affected Version

2025.4 - LTS (pimcore/copilot-bundle 2.5.x, still present on 2.5 HEAD; the classic admin UI file is gone from 2026.x)

Affected capability

Copilot

Affected bundle

pimcore/copilot-bundle (2.5)

Steps to reproduce

  1. Log in to the classic admin UI as a user whose permissions leave no actionable entry in the main menu (or with an empty main menu).
  2. Wait for the admin UI to start: Copilot builds its action store and requests the actions during startup (startup.js → mainWindow.controller).

Actual Behavior

public/js/pimcore/copilot/main-window/actionStore.js throws Cannot read properties of undefined (reading 'length') in addMenuActions():

addMenuActions() {
  if(this.menuActions.length === 0) return;   // menuActions is undefined

this.menuActions is only assigned in buildMenuActions(), and both createMenuActions() (empty menu) and buildMenuActions() (no actionable menu item) return before that. We see this in production error tracking for restricted users.

Expected Behavior

The action store treats "no menu actions" as an empty list: the server actions load and no error is thrown.

A fix is on its way as a PR to pimcore/copilot-bundle 2.5.

Activity

  1. changed the title [-]Copilot: opening the Copilot window as a user without menu entries throws "Cannot read properties of undefined (reading 'length')"[/-] [+]Copilot: admin UI startup throws "Cannot read properties of undefined (reading 'length')" for a user without menu entries[/+] on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Affected capability

    None yet

    Platform Version

    None yet

    Galaxy

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions