Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bulk actions hide or repeat per-document error messages (Edit many drops them; Delete/Publish/Unpublish repeat them)

Open
#18,837 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active

Research direction

Read packages/ui/src/forms/Form/index.tsx and the bulk action components under packages/ui/src/elements/, especially DeleteMany/index.tsx and the PublishMany, UnpublishMany, and RestoreMany equivalents. Trace how each handles json.message and json.errors, then find the related UI tests. Verify that public reasons appear once, all-fail publish actions show the headline, and partial failures still refresh the list while leaving the drawer behavior appropriate.

Written by the indexing model from the issue text.

Description

area: ui Bug
Describe the Bug

When a bulk operation fails for some or all documents, the REST response carries both a headline and the per-document reasons:

HTTP 400
{ "docs": [],
  "errors": [
    { "id": "a", "isPublic": true, "message": "You can't edit this page." },
    { "id": "b", "isPublic": true, "message": "You can't edit this page." }
  ],
  "message": "Unable to update 2 out of 2 Pages." }

The admin UI handles this badly in three places:

  1. Edit many drawer drops the reasons. packages/ui/src/forms/Form/index.tsx shows json.message and returns before reading json.errors. The editor sees only "Unable to update 2 out of 2 Pages." and never learns why. This applies to Save, Save Draft and Publish in the drawer.
  2. Bulk Delete, Restore and Empty trash repeat identical reasons. DeleteMany and its siblings build the toast description with json.errors.map((error) => error.message).join('\n'). When N documents fail for the same reason, the description repeats it N times.
  3. Bulk Publish and Unpublish open one toast per document when every document fails. The all-fail branch calls errors.forEach((error) => toast.error(error.message)), so N identical toasts open and the "Unable to update…" headline never shows.

A related point: a partial failure (1 of 3 refused) also returns 400. The Edit many form then treats it as a failure, so the drawer stays open and the list does not refresh, even though 2 documents were updated.

Link to the code that causes this issue
  • packages/ui/src/forms/Form/index.tsx (if (json.message) { errorToast(json.message); return })
  • packages/ui/src/elements/DeleteMany/index.tsx (json.errors.map((error) => error.message).join('\n')), plus the PublishMany, UnpublishMany and RestoreMany equivalents
Reproduction Steps
  1. Add a beforeChange hook to a collection that throws new APIError("You can't edit this page.", 403, null, true) for a non-admin user.
  2. As that user, select 2 documents in the list view and open Edit many. Change a field and save. Only "Unable to update 2 out of 2 …" appears.
  3. Select 2 documents and use Delete (with an equivalent beforeDelete hook). The description repeats the reason twice.
  4. Select 2 documents and use Publish. Two identical toasts open, and no headline appears.
Suggested fix
  • Form: when json.message is present and json.errors has public messages, append the unique ones to the toast. Single-document saves return no top-level message, so they are unaffected.
  • Bulk toasts: dedupe the messages, e.g. [...new Set(errors.map((e) => e.message))].join('\n').
  • Publish/Unpublish all-fail branch: show the headline with the deduped reasons as the description, as the partial-fail branch already does.

We patch this locally and are happy to open a PR.

Which area(s) are affected?

area: ui

Environment Info
Payload: 3.91.0
@payloadcms/ui: 3.91.0
Node.js: 24
Next.js: 16.3

The same code is still on main (v4.0.0-beta.2) and on 3.x.


This issue was found and reported with the help of Claude Code.

Dominant language
TypeScript
Stars
45.5k
Forks
4.3k
Avg merge
1d 21h
Merged PRs (30d)
302

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from payloadcms/payload

All issues in payloadcms/payload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.