simple-local-avatars icon indicating copy to clipboard operation
simple-local-avatars copied to clipboard

An error occurred cropping the image.

Open faisal-alvi opened this issue 3 years ago • 1 comments

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

faisal-alvi avatar Jul 19 '22 05:07 faisal-alvi

Update: Internal discussion with @ajmaurya99: https://10up.slack.com/archives/CG6QB7HEU/p1657221871321319

faisal-alvi avatar Jul 19 '22 06:07 faisal-alvi

@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 avatar Aug 23 '22 17:08 zamanq

@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 avatar Aug 30 '22 04:08 faisal-alvi

@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

zamanq avatar Aug 30 '22 05:08 zamanq

@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 avatar Sep 05 '22 06:09 faisal-alvi

@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

jeffpaul avatar Sep 06 '22 14:09 jeffpaul

Closing after #150

faisal-alvi avatar Sep 07 '22 05:09 faisal-alvi