club-soda / club-soda-guide

Mindful Drinking Movement - Club Soda MVP 2.0
https://club-soda-guide-staging.herokuapp.com
17 stars 0 forks source link

Images not updating on brand page #627

Closed jessyclubsoda closed 4 years ago

jessyclubsoda commented 5 years ago

We're experiencing an issue with drinks images not updating on brand pages.

Here's an example: Nirvana Brewery have done a rebrand so we uploaded new images for their beers.

Nirvana drink image

Here's the new image showing on the drink's individual listing in the back end

Nirvana drinks search

Here's the new image showing up fine when you search for the drink

Nirvana brand page

But when you look on the brand page, for one of the beers it has kept the old image (it's the beer on the far left and it's kinda hard to tell because the rebrand is quite subtle but it's got the old name "Karma")

We've had an identical issue happen with Square Root who have also had a rebrand

Any idea why this might be happening?

jessyclubsoda commented 5 years ago

Update - this issue is still continuing, this time with Pierre Chavin.

I accidentally uploaded the wrong photo for one of their drinks. On their brand page it is still showing that mistaken upload as you can see here

Screenshot 2019-10-18 15 34 10

Yet if I go into change the image, for the individual drink it is showing the correct one?

Screenshot 2019-10-18 15 37 45

jessyclubsoda commented 5 years ago

Nirvana and Square Root are our member brands so if we are able to do a force update these are the two brands that would be the best to do !

SimonLab commented 5 years ago

The image for the drink on the brand page are displayed with the following line: https://github.com/club-soda/club-soda-guide/blob/a7e9909a6ba94dc53308fc223f04d84d1fef06d2/lib/cs_guide_web/templates/components/drink_card.html.eex#L6

Which takes the last image from the list of existing image.

However when the datastructure is built we do not sort the images (ie the latest uploaded image should be the latest item on the list).

jessyclubsoda commented 5 years ago

Unfortunately we seem to be still have some issues with this

Square Root

Here on the brand page all of these Square Root images are old

Square Root in Brewdog

Here for Square Root represented on a venue page, it uses a different image, which also isn't the most recent one that was uploaded

Similarly on the Estrella brand page the old image for FreeDam is used

Estrella

The site pulls the most recent version when it is represented on a venue page

Estrella in Dishoom

This is also still an issue for Nirvana brewery

iteles commented 5 years ago

Thanks for this update @jessyclubsoda. If this fix didn't function, then this may be related to #522 so we will look into this as our next step! We'll get back to you on this next week.

SimonLab commented 4 years ago

I just had a better look at the order of the images. To display the drinks' image we use the drink_card template component for each drink and display the latest image from the list of the drink image: https://github.com/club-soda/club-soda-guide/blob/3a8da0319561c49f73f3c304c9e50fed147c8d47/lib/cs_guide_web/templates/components/drink_card.html.eex#L6-L9

However the order of the images created on the backend wasn't the correct one. I've updated the order for the venue page and for the brand page and tested locally with the real data to make sure it was displaying correctly.

SimonLab commented 4 years ago

@jessyclubsoda the images of the drinks should be displayed correctly now :+1: Let me know if you still spot any old images on the brand/venue

jessyclubsoda commented 4 years ago

This is looking a million times better thanks @SimonLab