[5.x]: `Actionable` Menu Items are Leaky
What happened?
Description
Fields can contribute action menu items that should appear in field layouts; the Matrix field uses this to provide a Copy all entries item.
However, Fields themselves are Actionable, meaning when they’re rendered as a chip, the field layout element-destined actions can appear out-of-context:
I believe this only currently manifests with Matrix fields… but it points to a broader design/intent issue with getActionMenuItems().
Steps to reproduce
- Create a section and entry type;
- Create a Matrix field and add it to the field layout;
- Open the Settings slideout from the field layout element;
- Open the action menu on the field chip at the top of that view;
Expected behavior
Only actions intended for use with the field (Field settings and Copy field handle) are shown.
Actual behavior
All items returned by the field are shown.
Craft CMS version
5.7.10
PHP version
8.2.28
Operating system and version
macOS / DDEV
Database type and version
MySQL 8.x
Image driver and version
No response
Installed plugins and versions
No response
Thanks August! PRs raised!
Fixed in 5.7.11!