buildLink with forcedomain=true returns wrong protocol

On a site with SSL the following code:

#event.buildLink( assetId=mainimage)#

returns the full url with https://


#event.buildLink( assetId=mainimage, forcedomain=true)#

returns the full url with http:// instead of https://


I remember, that forcedomain was needed to get the full URL, not the relative one. Did this behaviour changed?

I’m not sure that’s right. You should be able to just use event.buildLink( assetId=mainimage ). I think forcedomain was added for some specific scenario that you shouldn’t need to worry about in this instance.

Worth noting that there was a recent bug around asset URLs, so if you’re trying to address that, you might be better off checking latest version.

Excactly forcedomain was for some email linking. But meanwhile it seems to be obsolete for my purpose. But it still returns the wrong protocol.
Removing the attribute did it, and I will check the latest version.

Looking at the code, I do not see any obvious reason for this. It will be getting the protocol from the site. Can you check the protocol field in your psys_site table? Presumably should all be https.

it is set to https. I will do some testing.