Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred cropping the image. #141

Closed
1 task done
faisal-alvi opened this issue Jul 19, 2022 · 7 comments
Closed
1 task done

An error occurred cropping the image. #141

faisal-alvi opened this issue Jul 19, 2022 · 7 comments
Labels
type:bug Something isn’t working.

Comments

@faisal-alvi
Copy link
Member

faisal-alvi commented Jul 19, 2022

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

  • I agree to follow this project's Code of Conduct
@faisal-alvi faisal-alvi added the type:bug Something isn’t working. label Jul 19, 2022
@faisal-alvi faisal-alvi added this to the 2.6.0 milestone Jul 19, 2022
@faisal-alvi faisal-alvi moved this to Incoming in Open Source Practice Jul 19, 2022
@faisal-alvi faisal-alvi moved this from Incoming to To Do in Open Source Practice Jul 19, 2022
@faisal-alvi
Copy link
Member Author

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

@zamanq zamanq self-assigned this Aug 23, 2022
@zamanq zamanq moved this from To Do to In Progress in Open Source Practice Aug 23, 2022
@zamanq
Copy link
Contributor

zamanq commented Aug 23, 2022

@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 zamanq moved this from In Progress to To Do in Open Source Practice Aug 29, 2022
@zamanq zamanq removed their assignment Aug 29, 2022
@faisal-alvi
Copy link
Member Author

@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

@zamanq
Copy link
Contributor

zamanq commented Aug 30, 2022

@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

@faisal-alvi
Copy link
Member Author

@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.

@jeffpaul
Copy link
Member

jeffpaul commented Sep 6, 2022

@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

@faisal-alvi
Copy link
Member Author

Closing after #150

Repository owner moved this from To Do to Merged in Open Source Practice Sep 7, 2022
@faisal-alvi faisal-alvi removed this from the 2.6.0 milestone Sep 7, 2022
@faisal-alvi faisal-alvi moved this from Merged to Done/Released in Open Source Practice Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn’t working.
Projects
Archived in project
Development

No branches or pull requests

3 participants