Skip to content

Global update drops overrideAccess, so Local API updateGlobal fails filterOptions validation (3.90 regression) #18674

Open

Description

@FilipMessa

Describe the Bug

Since 3.90, validateFilterOptions queries with overrideAccess: overrideAccess ?? false. The collection update path threads overrideAccess into beforeChange, but the global update operation (packages/payload/src/globals/operations/update.ts, beforeChangeArgs) does not. So a Local API payload.updateGlobal(...) — whose overrideAccess defaults to true — validates relationship filterOptions as an anonymous user.

With a related collection using default access (signed-in only), any Local API global update without a user (seed scripts, integration tests) now fails:

ValidationError: The following field is invalid: <relationship field>

This worked in 3.88.0.

Link to the code that reproduces this issue

Minimal shape (no repro repo):

// collection `pages` with default access
// global with a relationship field:
{ name: 'link', type: 'relationship', relationTo: ['pages'], filterOptions: () => ({}) }

await payload.updateGlobal({
  slug: 'myGlobal',
  data: { link: { relationTo: 'pages', value: page.id } },
}) // ValidationError since 3.90

Reproduction Steps

  1. Global with a relationship field that has filterOptions, pointing at a collection whose read access requires a user.
  2. Call payload.updateGlobal from the Local API without user.
  3. Validation fails, although overrideAccess defaults to true.

Fix: add overrideAccess to beforeChangeArgs in the global update operation, mirroring the collection update utility. We run that one-line patch via pnpm patch.

Which area(s) are affected?

area: core

Environment Info

payload: 3.90.2
@payloadcms/db-sqlite: 3.90.2
Node: 26

Activity

  1. added
    area: core
    on Oct 13, 2026
  2. dinesh8999 commented on Oct 13, 2026

    @dinesh8999

    Hi! I'd like to contribute to this issue. I'll investigate how overrideAccess is passed through beforeChangeArgs in the global update operation and compare it with the collection update utility. I'll verify the regression and tests, then propose a focused fix following the project's conventions. Please let me know if anyone is already working on this. Thank you!

  3. clarson00 commented on Oct 23, 2026

    @clarson00

    Confirming this is still present in 3.92.0 (checked globals/operations/update.js — beforeChangeArgs has no overrideAccess, while collections/operations/utilities/update.js passes it).

    It also hits production paths, not only seeds/tests: a Next.js server action that saves a settings global with payload.updateGlobal({ slug, data }) after its own staff auth check. The global has a relationship to a collection whose read is staff-only, with an object filterOptions ({ pricingModel: { equals: '…' } }). On 3.88 the save worked; on 3.92 every valid choice is refused with ValidationError: The following field is invalid: <label>, because the lookup runs anonymously and finds nothing.

    Our interim workaround was removing filterOptions from that field (a beforeChange hook already enforces the constraint). Passing user to updateGlobal should also work, but the fix proposed above (thread overrideAccess into beforeChangeArgs) is the right one.

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

    Bugarea: core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions