Skip to content

Bugfix/18648 matrix actions and read only mode#18652

Merged
brandonkelly merged 7 commits into5.xfrom
bugfix/18648-matrix-actions-and-read-only-mode
Mar 31, 2026
Merged

Bugfix/18648 matrix actions and read only mode#18652
brandonkelly merged 7 commits into5.xfrom
bugfix/18648-matrix-actions-and-read-only-mode

Conversation

@i-just
Copy link
Copy Markdown
Contributor

@i-just i-just commented Mar 31, 2026

Description

In general, matrix entries (in any view mode) were not copyable when the owner was not editable.
In 5.8.18, we made matrix entries copyable when in static mode (one entry type allowed, and min/max set to the same value) (#17901).
In 5.9.0, we made matrix entries in blocks mode copyable as a result of this discussion: #18013 (link to the commit in the discussion).
As of 5.9.0:

  • matrix entries in blocks mode are copyable on a per-block basis and via the bulk action
  • matrix entries in cards view mode are copyable only via the bulk action
  • matrix entries in element index view mode are not copyable at all

issues:

  1. when in read-only mode and the matrix block is checked, the matrix field gets “duplicate selected blocks” and “delete selected blocks” actions, and it shouldn’t
  2. if you’re copying a block that doesn’t exist in the canonical element, it doesn’t really get copied; you don’t see a toast notification, and the paste buttons don’t show when you, e.g. view the canonical or another entry;
  3. pasting matrix entry copied from a revision doesn’t work

root causes:
re 2 => the copy action doesn’t work because when querying for the copied element to show its chip in the notification, the query doesn’t find and return the entry, and that’s because in the case the entry is already soft-deleted
re 2 and 3 => pasting doesn’t work because we’re not clearing revisionId

This PR ensures that it’s possible to copy the matrix entries from a revision and paste them into an editable context.
It also ensures that the duplicate and delete actions are not available when the field is static.

Related issues

#18648

@i-just i-just requested a review from brandonkelly March 31, 2026 10:07
[ci skip]
@brandonkelly brandonkelly merged commit 35dc15c into 5.x Mar 31, 2026
2 checks passed
@brandonkelly brandonkelly deleted the bugfix/18648-matrix-actions-and-read-only-mode branch March 31, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants