Skip Navigation

[Resolved] Custom Field URL prepending issue.

This support ticket is created 2 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 2 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#2286533

On the CPT archive page I have custom fields setup as "download" buttons. The one field in question has a URL inserted from a 3rd party site. This use to work, but somewher in the process it's prepending the URL with the actual website domain:

Correct URL:
hidden link

Incorrect URL:
hidden link

#2286901

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I assume you have labelled the correct URL and incorrect URL the wrong way round.

It looks like the incorrect URLs are being treated as relative URLs rather than absolute URLs so the site URL is being prepended, but we'd likely need to take a look at how you have this set up to understand what's going on.

Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.

Can you also confirm which archive we should be looking at, and which custom field is being output.

#2287429

CPT is "Supply Chain management"
Archive in Question is "Tenders and Contracts Cancelled"

Doesnt seem like my reply is private, can you please confirm before I insert login details

#2298843

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, there was a glitch in our system and this thread has been lost in no-man's land until now.

Let me try again with the private reply to get credentials.

#2299685

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, but I'm going round in circles trying to find where the problem is, the CPT and archive you describe, I can't find either.

Can you please guide me to where exactly I can see the problem.

#2306457

See link below to a archive for CPT where issue an be seen:

hidden link

Problem is that the URL for the link/download buttons are this:

hidden link

It should be this:
hidden link

The URL's are being prepended with "george.gov.za/" which is causing issues.

#2306477

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2022-03-02 at 08.51.26.png

I checked the first post in the results, "Monthly Award Tenders – September 2021", looking at the Document Upload URL field.

The URL is invalid, it begins https:/ rather than hidden link, and so Types appears to assume it is a relative URL rather than an absolute URL, and hence prepends the actual site URL.

I changed the value for just that post, and checked on the front-end, where it works.

You'll need to edit your remaining posts wherever they are using invalid URLs and replace with valid URLs.