simple-local-avatars
simple-local-avatars copied to clipboard
An error occurred cropping the image.
Describe the bug
A new bug was reported on the support forum.
Hi, clicking crop the image only lets me do it as admin. In roles such as author or editor I always get the error “an error occurred cropping the image”. I have tried disabling all plug-ins, but it still gives the same error. Any ideas, thanks.
Another user:
I am facing exactly the same problem, any idea would be helpful, thanks!
Steps to Reproduce
Try to crop the image as an author or editor. It will show an error and the images won't be cropped.
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Update: Internal discussion with @ajmaurya99: https://10up.slack.com/archives/CG6QB7HEU/p1657221871321319
@jeffpaul Alright, did some digging. Looks like the image cropping is handled by core customize-control script which has the action "crop-image" and only users with admin capabilities can access customizer related settings. FYI: Roles & Caps
So in our plugin we have nothing that prevents any editor or author to crop the avatar, it's the core customizer-control which prevents users other than admins to access that.
@zamanq do you think we should completely remove the crop feature (inherited from customizer) as this is preventing non-admins to crop images And replace it with another crop tool? (note: we'll create a separate ticket, just asking for your opinion) cc: @jeffpaul
@faisal-alvi Having the crop feature is useful for people when setting up their avatars because it's the personalization feature that they would expect to have in their profile page. So completely removing the crop feature may not be a good idea.
Instead we could introduce a custom cropping feature using third-party library that goes well in par with WordPress and that could be a better solution. cc: @jeffpaul
@jeffpaul Should we publish a new release (2.6.0) this month and tackle this "new crop tool" enhancement in a separate ticket and plan it for the next release (2.7.0)?
(Optional) We can also remove the existing crop feature with 2.6.0 (with a note that it was only working for admin roles).
Please share your thoughts.
@faisal-alvi I think it's fine to keep as-is for now and can adjust for all roles with the new approach in the next release
Closing after #150