cloudinary / cloudinary_wordpress

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

Cloudinary urls replaced everywhere in the admin but not when accessing acf fields directly #900

Closed hlidotbe closed 1 year ago

hlidotbe commented 1 year ago

Bug Description

We have a headless setup and extensively use ACF for our websites. When filling a "link" field with a copy/pasted cloudinary url, the url is replaced by the /wp-content/uploads... url in the database. When displayed in the admin the correct url is shown but when using "get_field" we still get the wp-content url instead of the expected cloudinary one. Since storage is set to cloudinary only, it results in errors as the files are not actually available locally.

Expected Behaviour

Either the url saved in database is what we actually set in the content of the page (prefered) or get_field get_postmeta return the correct url.

Steps to reproduce

  1. Create a page containing ACF fields of type Link
  2. Edit the base and set the link to a cloudinary url from the uploaded medias
  3. Save the page
  4. Call get_field on a link field for this post

Screenshots

Field as visible in the admin:

image

Database Content:

image

Field as fetch from wp shell:

image

Additional context

wissam-khalili commented 1 year ago

Hi there,

Thank you for reaching out.

How do you pull data from the system? Is it the Rest API, GraqhQL or something else ?

Could you please create a ticket to support@cloudinary.com with the system report attached as explained here? Could you also please, before generating the report, make sure that you include images in your report as explained here? In case it will be necessary, will you be willing to provide us with temporary access to a sandbox environment of your site where we can take a look and debug if needed?

Thanks, Wissam

hlidotbe commented 1 year ago

We load data through a custom rest route. I've sent a mail with the requested info.