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

[Bug] Error when checking canViewField from a console request #11

Closed tomdavies closed 4 years ago

tomdavies commented 4 years ago

Hey, I'm seeing errors when using Feed Me to import entries on a site that I'm trying out this plugin on, as the plugin expects an instance of craft\web\User when for a console request $user will instead be acraft\console\User:

thejoshsmith\fabpermissions\services\Fab::canViewField() must be an instance of craft\web\User, instance of craft\console\User given, called in /app/vendor/thejoshsmith/craft-fab-permissions/src/services/Fields.php on line 32 - Fab.php: 98
moacode commented 4 years ago

Hey @tomdavies, thanks for reporting this. Could you please give me a few more details so I can replicate?

I've done the following so far:

The feed imported fine for me without triggering the error, so any setup details you can give me would be really helpful. Also—Which version of the plugin are you using?

Cheers, Josh

moacode commented 4 years ago

Disregard the above @tomdavies: I can now replicate!

moacode commented 4 years ago

@tomdavies this should now be resolved in release 1.2.2. Please let me know if you're still experiencing issues.

tomdavies commented 4 years ago

@thejoshsmith awesome, many thanks for the quick fix