Skip to content

Switching to another administration does not stick, the first administration comes back after the page reloads #1685

Open

Description

@rubenvdlinde

What goes wrong

A user who keeps more than one administration picks another one in the switcher, the page reloads, and the first administration is active again. The switch is never stored. Code reading at ea0c9e574f34; needs a live check (a user with two memberships, switch, reload, read /api/administrations/context).

What the matrix says

Row led-multi-admin in the capability matrix merged in #1677 (merge sha 5662227, tree read at ea0c9e574f34): AdministrationController.php:128 switch() only validates and echoes the id, and AdministrationContextService.php:181 always returns the first membership as activeAdministrationId.

What I saw when I re-read the paths

  • lib/Controller/AdministrationController.php:128-154 switch() (route administration#switch, POST /api/administrations/switch, appinfo/routes.php:131) reads administrationId and calls resolveSwitchTarget(). It then returns {"activeAdministrationId": <id>} (:153). It writes no session value, user preference or object.
  • lib/Service/AdministrationContextService.php:286-291 resolveSwitchTarget() checks the membership and returns the id. It also stores nothing.
  • lib/Service/AdministrationContextService.php:144 buildContext() builds the list of valid memberships and sets activeAdministrationId to $administrations[0]['administrationId'] (:182-185), whatever was switched to.
  • src/components/AdministratieSwitcher.vue reloads the page after a successful switch (its docblock, line 18, and the reloadAfterSwitch prop). Pages then read activeAdministrationId from the context endpoint again, for example src/views/BudgetGrid.vue:284, src/views/bookkeeping/dimensions/SegmentPnLDashboard.vue:259, src/components/goods-receipt-note/GoodsReceiptNoteForm.vue:279-280 and src/components/Dashboard/BBVComplianceDashboard.vue:246-247.

The matrix also notes that generic index pages such as General Ledger carry no administrationId filter. I did not re-verify that part for this issue.

Why it matters

A bookkeeper for several entities cannot work in any administration but the first. Worse, screens that take the administration from the context (budget grid, segment P&L, goods receipt form) keep reading and writing the first administration while the user believes they switched.

Source: capability matrix in #1677, row led-multi-admin.

Activity

  1. github-actions commented on Sep 25, 2026

    @github-actions
    Contributor

    Thank you for opening this issue! It has been assigned to @rubenvdlinde for review.

    What happens next:

    1. A maintainer will review this issue and determine the appropriate action
    2. If accepted, it may be converted into an OpenSpec change for structured development
    3. You will be notified of any status changes

    Triage labels:

    • triage:accept-feature — accepted as a new feature
    • triage:accept-bugfix — accepted as a bug fix
    • triage:needs-info — more information needed
    • triage:wontfix — will not be addressed
    • triage:duplicate — duplicate of another issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

triageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions