craft-fab-permissions icon indicating copy to clipboard operation
craft-fab-permissions copied to clipboard

Permissions overwritten if the same field is re-used in different layouts

Open goraxan opened this issue 4 years ago • 2 comments

Due to how the Craft fields service handles layout updates (they delete the layout and re-create it every time https://github.com/craftcms/cms/blob/master/src/services/Fields.php#L1248) the permissions attached to one field get deleted every time a layout is saved because the ON CASCADE FK on fieldId references the fieldlayoutfields table. When the Fab service saves the permissions (in the saveFieldLayoutPermissions method) it only saves the permissions of the layout being modified at that moment, the rest remain deleted.

Is there any way to re-use a field across different layouts?

goraxan avatar Jul 02 '20 15:07 goraxan