wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Header image error with Author role

Open ethicalrevolution opened this issue 1 year ago • 4 comments

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

  1. Logged in as an Author, go to Profile page in back end of Wordpress site.
  2. Under the ActivityPub header click on ‘Choose a Header Image’.
  3. Pick image and click on ‘Set as Header Image’.
  4. Goes to cropping page even if image is already cropped to exact size. Only option is to click ‘Crop Image’.
  5. 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

ethicalrevolution avatar Aug 01 '24 15:08 ethicalrevolution

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 ?

pfefferle avatar Aug 02 '24 09:08 pfefferle

@mattwiebe maybe we have to create a nonce in the PHP code and pass it to the JS?

pfefferle avatar Aug 02 '24 09:08 pfefferle

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?

pfefferle avatar Aug 02 '24 10:08 pfefferle

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

Screenshot 2024-08-02 at 19 13 43

mattwiebe avatar Aug 02 '24 21:08 mattwiebe

this will be fixed in the next release! thanks @mattwiebe for finding and solving the issue!

pfefferle avatar Sep 19 '24 10:09 pfefferle