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

2.7.6 Introduces Breaking Changes For Avatars Outside the Media Library #246

Closed
1 task done
jakejackson1 opened this issue Dec 5, 2023 · 2 comments · Fixed by #247
Closed
1 task done

2.7.6 Introduces Breaking Changes For Avatars Outside the Media Library #246

jakejackson1 opened this issue Dec 5, 2023 · 2 comments · Fixed by #247
Assignees
Labels
type:bug Something isn’t working.
Milestone

Comments

@jakejackson1
Copy link

jakejackson1 commented Dec 5, 2023

Describe the bug

The changes introduced in #216 cause multiple breaking-changes for avatars not stored in the media library (no media_id).

If the avatar has been previously set with Simple_Local_Avatars::assign_new_user_avatar( $url, $user_id ) – or via a third party – and is not stored in the media library, the following breaking changes occur:

  1. The rating system is bypassed when the requested size exists. This allows for X/R-rated avatars to be displayed on a G-rated site
  2. If a requested image size does not exist, and the image is stored in the uploads directory, it will no longer be dynamically generated
  3. If a requested image size does not exist, and the image is not stored in the uploads directory/or dynamic resizing is turned off or fails, the full-size image is not returned

I was originally going to submit a PR to fix item 3, which is the bug I first found. But the more I reviewed the changes, the more fundamental issues I found with the newly-introduced changes (also #245). I'd strongly consider rolling back #216 👍

Steps to Reproduce

For bug 1

  1. In v2.7.5 use $simple_local_avatars->assign_new_user_avatar( $url, $user_id ) to assign an image stored in the uploads directory (but not the media library)
  2. Go to the associated user profile and set the rating to R
  3. Go to Settings -> Discussions and ensure the site rating is set to G
  4. Leave a comment on a post as the user. The avatar will show the fallback in the comment.
  5. Upgrade to v2.7.6 and view the comment. The rated R avatar will be showing.

For bug 2

  1. In v2.7.5 use $simple_local_avatars->assign_new_user_avatar( $url, $user_id ) to assign an image stored in the uploads directory (but not the media library)
  2. View the user profile (lets call this User A) and see the fallback avatar
  3. Leave a comment on a post as the user. A resized version of the avatar will show
  4. Upgrade to 2.7.6 and repeat the above steps with a separate user (User B)
  5. User A will have their avatar showing in the comments, while User B will have the fallback avatar

For bug 3

  1. In v2.7.6 use $simple_local_avatars->assign_new_user_avatar( $url, $user_id ) to assign an image stored in the uploads directory (but not the media library)
  2. View the user profile and see the fallback avatar

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
Copy link
Member

@jakejackson1 fix #247 (reverting #216) is merged into the develop branch, can you please confirm the issues mentioned above are fixed?

@faisal-alvi faisal-alvi reopened this Dec 8, 2023
@github-project-automation github-project-automation bot moved this from Merged to In Progress in Open Source Practice Dec 8, 2023
@faisal-alvi faisal-alvi added the needs:feedback This requires feedback to determine next steps. label Dec 8, 2023
@jakejackson1
Copy link
Author

@faisal-alvi thanks. I can confirm all three issues are now fixed in the develop branch 👍

@github-actions github-actions bot removed the needs:feedback This requires feedback to determine next steps. label Dec 11, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Merged in Open Source Practice Dec 11, 2023
@jeffpaul jeffpaul added this to the 2.7.7 milestone Dec 13, 2023
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

Successfully merging a pull request may close this issue.

3 participants