Header image error with Author role
Quick summary
Even if I try to upload an image that is the correct dimensions for the profile header image I am asked to crop the image (no option to do otherwise) and when clicking the button to do so I get an error. This happens when I am an Author, but not when I am an Administrator in Wordpress. (ActivityPub is enabled for Author role.)
Steps to reproduce
- Logged in as an Author, go to Profile page in back end of Wordpress site.
- Under the ActivityPub header click on ‘Choose a Header Image’.
- Pick image and click on ‘Set as Header Image’.
- Goes to cropping page even if image is already cropped to exact size. Only option is to click ‘Crop Image’.
- When I do so I get an error which says, “There has been an error cropping your image.”
What you expected to happen
The image should become my header image, as it does when I try with an Admin role log in.
What actually happened
Error message received.
Impact
One
Available workarounds?
No but the platform is still usable
Logs or notes
No response
That's weird and I can reproduce it. It seems that something with the nonce is broken, but I can't see any difference between user roles.
Can you maybe also have a look @mattwiebe ?
@mattwiebe maybe we have to create a nonce in the PHP code and pass it to the JS?
The weird thing is, that I can only reproduce it locally on my server it works like it should be. Was there a change in the latest WordPress release that broke the cropper?
~Hmmm I can't duplicate, working fine on my local install…~
EDIT oh, right, as an author level user. Yeah, I can reproduce. Not sure why, don't have time to investigate further right now. This is what happens when I try to crop.
this will be fixed in the next release! thanks @mattwiebe for finding and solving the issue!