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
404 default.png image path in profiles table (database) #3795
Comments
A simple UPDATE profiles
SET image_url = REPLACE(image_url, 'images', 'assets'),
image_url_small = REPLACE(image_url_small, 'images', 'assets'),
image_url_medium = REPLACE(image_url_medium, 'images', 'assets')
WHERE image_url LIKE '%images/user/default.png'; baked into a migration should do. But requires testing! :P |
I'm newcomer :-) @MrZyx is it done?? If not, Can you help me to fix this :-) |
Sorry, won't be online too much over the holidays. But if you want to try it, don't let that stop you ;). So try to replicate the situation in your local database and then see if you can fix it :) |
@YasirAdnan are you currently working on this ? You just have to test the SQL @MrZyx posted above, and look if you have the expected behavior. |
@Flaburgan Yes, I'm currently working on this. I will be happy if I can more help from you and @MrZyx. As, I'm a newcomer.:-) |
Just ask, what do you need ? (Btw, I'm a newcomer too :) ) |
I've been seeking on how to solve this issue and finally got to the implementation of the # profile.rb
def image_url(size = :thumb_large)
result = if size == :thumb_medium && self[:image_url_medium]
self[:image_url_medium]
elsif size == :thumb_small && self[:image_url_small]
self[:image_url_small]
else
self[:image_url]
end
result || '/assets/user/default.png'
end Isn't the line for the method return enough to accomplish the solution? Could you guys clarify why this change on database is still necessary? |
I can't pinpoint it but there was a time where we wrote the default profile picture into the database: diaspora_production=# SELECT COUNT(*) FROM profiles WHERE image_url LIKE '%images/user/default.png';
count
-------
54
(1 row) Edit: Actually we still do that, maybe because we write the default picture into the HCard so it gets stored when fetching a remote profile. |
…image-url Fix default image url in profiles table. Closes #3795
Before asset pipeline the image path was
https://diasp.eu/images/user/default.png
With the asset pipeline the path changed to
https://diasp.eu/assets/user/default.png
I think we need some script to solve the migration problem!?
Table: profiles
Columns: image_url, image_url_small, image_url_medium
Changes: from /images/ to /assets/
The text was updated successfully, but these errors were encountered: