Needs review
Project:
Twitter
Version:
7.x-6.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2014 at 05:23 UTC
Updated:
30 Aug 2018 at 15:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damienmckennaPlease leave the issue status at "Active" when you open an issue, "Needs work" is for when someone uploads a patch but the patch itself needs work. Thanks for opening the issue!
Comment #2
damienmckennaWhich image is broken - their Drupal user profile pic or their Twitter pic? Can you please provide some example HTML to show what it looks like after they update their account?
Comment #3
kevinchampion commentedI believe the issue here is that the twitter account profile information can become outdated, specifically the data retrieved from the users_show API endpoint. This includes the twitter account profile image url stored in twitter_account->profile_image_url.
Steps to reproduce
- Add an unauthenticated twitter account
- Confirm that the account's profile photo was correctly retrieved and displays on the listing page
- Change the twitter accounts profile photo on twitter.com
- Confirm that the account's profile photo on the listing page is now a broken image
This user data is retrieved from users_show API endpoint, which only gets called when an authentication attempt happens in twitter_signin.module or when a user (authenticated or unauthenticated) is added at admin/config/services/twitter. Since in most cases the data is only retrieved once, there's no facility to keep it up-to-date over time. So, when a user updates their profile photo on twitter.com, twitter removes the previous profile photo and this leads to the broken images.
Fixing this could be a user-triggered configuration action, but it seems better as an automated routine that runs periodically in the background to keep the data up-to-date. The attached patch does just that by adding a call to make a request to users_show in an effort to update the twitter profile information stored in Drupal.
Comment #4
liampower commentedPatch works for me
Comment #5
damienmckennaThe new function needed a little tweaking to handle the auth process better.
Comment #6
liampower commentedPatch #5 also works for me.
Comment #7
kevinchampion commentedFound that an outdated profile could be present in the list of users (for instance if a Twitter account was deleted), which causes breakage. Added a check on the returned data from Twitter to prevent such a problem.
Interdiff 5-7
Comment #8
liampower commentedThe patch from #7 breaks as twitter_fetch_user_account required a $twitter_account as an object, not just the ID.
Added a fixed patch.
Comment #9
rossb89 commentedJust ran into this issue, confirmed patch #8 seems to do the trick!
I haven't tested thoroughly if this impacts anything else as we only have a very simple use case of pulling in some tweets and displaying them in a view. But running the site cron after the patch applied results in the profile information being updated as intended with no errors / warnings on cron etc.