moacode / craft-fab-permissions

Restrict access to fields and tabs for particular user groups across your Craft elements.
Other
16 stars 9 forks source link

Update the FieldDecorator to be compatible with Craft v3.7 #27

Closed JoshCoady closed 3 years ago

JoshCoady commented 3 years ago

When upgrading from Craft 3.6 to 3.7 I got a 500 error when trying to create a new entry with a user that does not have edit permissions for all fields of the entry.

Error message in the logs:

PHP Fatal error: Class thejoshsmith\fabpermissions\decorators\StaticFieldDecorator contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (craft\base\FieldInterface::getOrientation, craft\base\FieldInterface::getStatus, craft\base\FieldInterface::copyValue) in /var/app/vendor/thejoshsmith/craft-fab-permissions/src/decorators/StaticFieldDecorator.php on line 9

This PR adds those three missing FieldInterface functions.

moacode commented 3 years ago

Thanks @JoshCoady, I'll take a look at this later today. BTW I'm planning on revisiting the project config, just haven't quite got there yet.

JoshCoady commented 3 years ago

I forgot to update my fork to latest, so my prior commit wasnt quite right and included some extra junk. The force pushes corrected this so that it is now clean and only contains the necessary changes.

moacode commented 3 years ago

Thanks for this @JoshCoady, works great.