cloudinary / cloudinary_wordpress

Cloudinary's WordPress plugin
GNU General Public License v2.0
39 stars 28 forks source link

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

Closed cfab closed 6 months ago

cfab commented 2 years ago

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

Vdeub-cloudinary commented 2 years ago

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

cfab commented 2 years ago

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 commented 2 years ago

Any update on this? @cfab @Vdeub-cloudinary

cfab commented 2 years ago

no answer !

Le 6 févr. 2022 à 18:04, ashleynexvelsolutions @.***> a écrit :

Any update on this? @cfab https://github.com/cfab @Vdeub-cloudinary https://github.com/Vdeub-cloudinary — Reply to this email directly, view it on GitHub https://github.com/cloudinary/cloudinary_wordpress/issues/670#issuecomment-1030872763, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGLKD66YWMSGPXM2AWLR6LUZ2SY5ANCNFSM5MNT5XCQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.

Vdeub-cloudinary commented 2 years ago

@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 commented 2 years ago

ok thank you !

Le 7 févr. 2022 à 10:31, Loic @.***> a écrit :

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

— Reply to this email directly, view it on GitHub https://github.com/cloudinary/cloudinary_wordpress/issues/670#issuecomment-1031253040, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGLKDYOU5PYZ5ZAKHYMERTUZ6GQPANCNFSM5MNT5XCQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.

Vdeub-cloudinary commented 2 years ago

@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 commented 2 years ago

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

thrugl commented 2 years ago

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

aleksandar-cloudinary commented 2 years ago

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

Vdeub-cloudinary commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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
      }
    }
    }
    }
  5. In the QUERY VARIABLES field just below the field for queries, add the following JSON object:

    {"uri": "sample-page"}
  6. 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: https://github.com/funkhaus/wp-graphql-cors/issues/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 commented 1 year ago

@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 commented 1 year ago

@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 commented 8 months ago

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

LarsEjaas commented 8 months ago

@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 🙂