Skip to content
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

Srcset returning local media url instead of azure url #128

Open
nreddipalle opened this issue Nov 10, 2020 · 3 comments
Open

Srcset returning local media url instead of azure url #128

nreddipalle opened this issue Nov 10, 2020 · 3 comments
Labels
type:bug Something isn’t working.

Comments

@nreddipalle
Copy link

Tested on WordPress Version: 5.5.3
Plugin Version: 4.3.1

Used this Plugin https://wordpress.org/plugins/velvet-blues-update-urls/ to update my urls..
On viewing page source, I still find SrcSet returning local media URL even when Src is showing correctly Azure Blob url fine..

<p><img class="alignnone wp-image-1815" src="https://senseimarketingstaging.blob.core.windows.net/uploads/2018/08/Team_Eggplant_Blues.png" alt="Team of three people" width="116" height="75" srcset="https://stage.senseilabs.com/wp-content/uploads/2018/08/Team_Eggplant_Blues.png 556w, https://stage.senseilabs.com/wp-content/uploads/2018/08/Team_Eggplant_Blues-300x194.png 300w" sizes="(max-width: 116px) 100vw, 116px" /></p>

How to fix this??

@nreddipalle nreddipalle added the type:bug Something isn’t working. label Nov 10, 2020
@nreddipalle
Copy link
Author

@jeffpaul ??

@jeffpaul jeffpaul added this to the Future Release milestone Nov 12, 2020
@jeffpaul
Copy link
Member

@nreddipalle apologies, I don't have an immediate answer for you. We'll try and take a look into this, but in the meantime have you validated functionality with the Velvet Blues team?

@bpalme
Copy link

bpalme commented Oct 7, 2022

I had a similar issue. Our situation is that we are migrating existing uploads to Azure storage manually. I'm not sure if this is the same situation as the OP. (This is with plugin version 4.3.3 and WP vsn 6.0.2.)

The issue is in the windows_azure_storage_wp_calculate_image_srcset function, it is trying to pull the azure metadata (windows_azure_storage_info) for the post but there isn't any since the uploads were manually added. I modified the function to replicate the part of windows_azure_storage_wp_generate_attachment_metadata that adds the metadata to the table (without the parts that push files up). So when loading the page, if it doesn't detect the metadata, it adds back in at that point.

I'm willing to do a PR if you want, but I'm not sure that is the best way to handle this in the long run. At the very least we could refactor that metadata update into a new function that could be called from either of the two existing ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn’t working.
Projects
None yet
Development

No branches or pull requests

3 participants