OpenNews / opennews-source

Code refactor for Source, a website that spotlights work from the developers, designers, and data analysts at the intersection of journalism and tech: https://source.opennews.org
MIT License
5 stars 3 forks source link

Missing images—path problem? #91

Closed kissane closed 7 years ago

kissane commented 7 years ago

I was just looking at some broken images on staging while Juna finished dinner, and noticed two things that may be causing some problems.

screen shot 2017-02-06 at 8 00 50 pm

Much obliged for any assistance you can offer, @ryanpitts!

ryanpitts commented 7 years ago

1) Yep, I can run a db update that looks for that hacky bit of script that hides broken images and removes it. Will let you know once it's run.

2) Ah, this is an artifact of the way uploads used to be stored on the application server itself rather than being stored in a separate media location. So all inline article imgs pointing to places like /media/img/uploads/article_images/streamtools_fig1.png are looking for files at https://opennews-source-staging.herokuapp.com/media/img/uploads/article_images/streamtools_fig1.png, and need to be repointed to the new media.opennews.org location, like https://media.opennews.org/img/uploads/article_images/streamtools_fig1.png. Can also run a db update for this.

kissane commented 7 years ago

That would be awesome, many thanks! Doing it article-by-article would take more days than we have, I think.

ryanpitts commented 7 years ago

OK, since I already wrote scripts and ran them, let's go with the db update method then!

Should look better now: https://opennews-source-staging.herokuapp.com/articles/introducing-streamtools/

kissane commented 7 years ago

Fine, Ryan, just FIX it then, see if I care.

kissane commented 7 years ago

I think there might be a slight pattern variation to deal with, as I'm seeing some that still look like https://source.opennews.org/media/img/uploads/article_images/smoking_gun.png in articles like https://opennews-source-staging.herokuapp.com/admin/articles/article/254/change/ — it looks like we have the absolute path in some articles, I think maybe the ones Casey or Kio produced.

ryanpitts commented 7 years ago

OK, these patterns are all updated in the staging db

kissane commented 7 years ago

Tested and looking perfect, thanks! Closing.