Skip Navigation

[Resolved] Some fields now output GUID instead of URL. ie: types_render_field( "my-image" )

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#908946

Since the update to 3.0 field outputs (ie: types_render_field( "my-image" ) ) will now actually output the guid (wp_toolset_post_guid_id?) instead of the URL in the image it generates.

This causes issues if the guid happens to be different than the url after a domain change. Typically you are not recommended to update GUID's in the database.

#909191

Hello,

The problem you mentioned above is abnormal, in case it is a compatibility problem, please try this:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a database dump file (ZIP file) of your website in below private detail box, also point out the problem page URL, I need to test and debug it in my localhost, thanks

#911627

Thanks for the details, I am checking it in your website, will update this thread if there is anything found

#911641

I can see the problem in your website, here is what I found

Q1) 'raw'=>true no longer is supported (this was the previously suggested method),
According to our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
There isn't 'raw'=>'true' syntax, to get the raw image URL, please try attribute 'output'=>'raw'
It has been escalated to our 2nd tier supporters, see it in your thread:
https://toolset.com/forums/topic/select-field-not-outputting-proper-value-for-arrayrawtrue/#post-911490

Q2) Output URLS are coming from a GUID in the database rather than the url.
Yes, you are right, the Types image field outputs the image value from GUID field, I suggest you update your database, update the GUID field values according to your new website URLs, for example, you can try these:
1) Backup your website database first,
2) run below mysql query in your with mysql tools, for example PHPmyadmin:

UPDATE uecow_posts SET guid = REPLACE(guid, '<em><u>hidden link</u></em>', '<em><u>hidden link</u></em>') WHERE guid NOT LIKE '%{%';

More help:
https://toolset.com/faq/how-do-i-migrate-a-wordpress-site-from-one-domain-to-the-other/#2-updating-urls-in-posts-and-custom-fields