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

Local URL for media instead of Cloudinary URL in rest api #670

Closed
cfab opened this issue Jan 20, 2022 · 18 comments
Closed

Local URL for media instead of Cloudinary URL in rest api #670

cfab opened this issue Jan 20, 2022 · 18 comments
Assignees

Comments

@cfab
Copy link

cfab commented Jan 20, 2022

This is a big pbl when using Wordpress as a headless CMS...

@Vdeub-cloudinary
Copy link

@cfab could you share more details on this? Are you using a Custom REST API endpoint or the core one?

@cfab
Copy link
Author

cfab commented Jan 27, 2022

Hello,
with the version <3, the given url for a media in the rest api (or using wp-graphql) was the cloudinary media url
Since version 3, the given url is the local url, why did you change this ?
see screenshot below (now and then before v3 - look at the sourceUrl data) - or is it just me ?
Capture d’écran 2022-01-27 à 12 23 52
Capture d’écran 2022-01-27 à 12 24 34

@ashleynexvelsolutions
Copy link

Any update on this? @cfab @Vdeub-cloudinary

@cfab
Copy link
Author

cfab commented Feb 7, 2022 via email

@Vdeub-cloudinary
Copy link

@ashleynexvelsolutions @cfab - we are working on this and hope to have a fix for 3.0.2.
I'll keep you posted on this.

@cfab
Copy link
Author

cfab commented Feb 7, 2022 via email

@Vdeub-cloudinary
Copy link

@qdz90 - it is fixed when requesting the content but not when requesting image nodes. For the image nodes, it is fixed in 3.0.3 that will be released next week.

@Vdeub-cloudinary
Copy link

We have released 3.0.3 that fixes this issue. Please upgrade and let us know if you still encounter any issues. Thanks!

@thrugl
Copy link

thrugl commented May 5, 2022

After updating to 3.0.3 from 2.x.x, I am now experiencing this problem

@aleksandar-cloudinary
Copy link

Hi @thrugl, Could you please share the query you're running and the output?

@Vdeub-cloudinary
Copy link

Hi @thrugl, to add to Aleksandar's message. Could you please open a ticket to support@cloudinary.com with a system report? If you can also share if it is happening for all images or specific ones that could also be helpful.

@LarsEjaas
Copy link

I am experiencing the same issue using the Cloudinary WordPress plugin v. 3.0.9 and WPGraphQL plugin v. 1.13.9.
If I check the URL inside WordPress admin when editing Posts and Pages I get the correct Cloudinary media URL, But when using the GraphQL API endpoint (or using the GraphiQL explorer) I get the WordPress image url.
I have tried downgrading the Cloudinary plugin, however v. 2.7.6 of the plugin crash in the post editor of WordPress v. 6.1.1

@Vdeub-cloudinary
Copy link

Hi @LarsEjaas, could you please open a ticket to support@cloudinary.com with a system report and an example of GraphQL Query you are doing? Thanks!

@LarsEjaas
Copy link

LarsEjaas commented Aug 14, 2023

I am sorry for not getting back earlier!

After some debugging I have narrowed the issue I am experiencing to the use of an authorization plugin I use to set CORS headers to my headless frontend:
https://github.com/funkhaus/wp-graphql-cors

I guess this is probably out of the scope of the support from you guys 🙂 But this is how it can be replicated:

  1. Install the WPGrapQL WordPress plugin, the WP Graphql Cors plugin and the Cloudinary WordPress Plugin. Make sure the default "Sample Page" is published and add a featured image to the page hosted on Cloudinary.

  2. Rightclick the featured image and copy the image URL to make sure it points to a Cloudinary URL.

  3. Go to the: GraphiQL IDE menu point inside WP admin.

  4. Inside the IDE add the following graphQL query:

query GET_PAGE(
  $uri: ID!
) {
  page: page(id: $uri, idType: URI) {
    featuredImage {
      node {
        sourceUrl
      }
    }
  }
}
  1. In the QUERY VARIABLES field just below the field for queries, add the following JSON object:
{"uri": "sample-page"}
  1. Click the Execute Query ▶️ button inside the GraphiQL IDE.

Expected behavior

I expect the image slug/URL to point to Cloudinary. I got a slug/URL pointing to the WordPress domain.

Issue created for the WP GraphQL Cors plugin

I have created an issue here: funkhaus/wp-graphql-cors#45
I consider this resolved from your side really, as the Cloudinary plugin is working fine when I disable the WP GraphQL Cors plugin 🙂

@Vdeub-cloudinary
Copy link

@LarsEjaas
Thanks for the detailed explanation.
I will try to reproduce the issue on my side and see if there is anything we can do.
I'll keep you posted if I find anything interesting.

@LarsEjaas
Copy link

@LarsEjaas Thanks for the detailed explanation. I will try to reproduce the issue on my side and see if there is anything we can do. I'll keep you posted if I find anything interesting.

Thanks @Vdeub-cloudinary - please reach out if you need further details!

@Vdeub-cloudinary
Copy link

@LarsEjaas we have released 3.1.6 that should fix this issue.
Please let us know if it is not the case!

@LarsEjaas
Copy link

LarsEjaas commented Jan 18, 2024

@LarsEjaas we have released 3.1.6 that should fix this issue. Please let us know if it is not the case!

@Vdeub-cloudinary This is incredible! I am so hyped about this: Can't wait to check it out! Thanks a lot for taking the time to write to me 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants