If a video is posted on Instagram only the text associated with post is pulled through. This then pushed the whole gallery of other images out of alignment. Please see image attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Road Kill created an issue. See original summary.

Jānis Bebrītis’s picture

Checked the feed, structure still seems the same, thumbnail URLs work too, but database has invalid thumb URL - it returns "URL signature expired" when loaded.

This could be temporal fix, but removing signature from instagram thumbnail URL solves the issue for new items.
Solution found here:
https://github.com/stevenschobert/instafeed.js/issues/549
https://stackoverflow.com/questions/47668014/instagram-feed-api-media-ur...

As of existing items - you have to locate them in table `instagram_social_feed_photos` and remove those rows. Rerun cron (or `drush ev 'instagram_social_feed_cron()'`), items will be re-imported along with creation time so they will be sorted correctly in block too.

capysara’s picture

Patch applied cleanly to 7.x-1.5. I just deleted all the photos and then re-ran the import. It appears to work, but I believe that the URL expiration occurred a few days after the images were imported. I'll keep an eye on it to be sure it holds.

Thanks Jānis Bebrītis!

UPDATE: I've had this patch in place since last month and it doesn't appear to be working any more. In fact all of my images and videos thumbnails are gone. I'm not sure if it's a result of the patch or some other config on my site, but regardless, it's not working for me anyway.

Thank you again! I'll keep looking into this and update when I find a solution that works for me.

Jānis Bebrītis’s picture

Status: Active » Reviewed & tested by the community
Barnettech’s picture

We are running 7.x-1.5 and it did not pull in a video posting, just showed a broken image instead. Are others showing this as fixed in 7.x-1.5 ?

mattgross’s picture

Patch in #2 worked for us, after deleting all photos and re-importing.

It would be ideal if there were some way to distinguish videos from other types of media, that way we could put a play icon over the thumbnail or something.

(edit) We're using 7.x-1.5

Barnettech’s picture

I just poked around for a long while, what were the exact steps to take to delete photos and reimport?

mattgross’s picture

FileSize
46.83 KB

Added a screencap of the delete/reimport page (admin/config/services/instagram_social_feed/status).

There's a link underneath the Run button that allows you to delete all the photos, then Run re-imports the most recent 20.

Barnettech’s picture

ah thank you! I was blind (apparently) but now I can see it!

Jānis Bebrītis’s picture

I removed missing images by copying instagram link from them and using it in drush command

drush sqlq "DELETE FROM instagram_social_feed_photos where instagram_link = 'https://www.instagram.com/p/ABCD1234/';"

then drush cron and it will pull the latest items again.

arskiainen’s picture

Status: Reviewed & tested by the community » Closed (cannot reproduce)

Instagram apparently fixed this on their end, so the patched version (#2) uses image urls that return Access Denied.

The stable works (for me at least) correctly without the patch now.

I'm closing this since it's no longer a relevant issue. I hope that's okay.

luisnicg’s picture

I reversed the patch as @arskiainen suggested in #11. After doing this it worked but I get this error:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'user_id' at row 1

I changed the user_id from INT to BIGINT in case someone faces this issue.