How can I customize deeplink host + port?

Hello,

I need to customize deeplink generation – to set a specific, custom host and port, irrespective of the domain the user who is copying the deeplink signed in with.

It’s because of the specific network setup our client has. They send deeplinks to their partners often and changing the deeplinks manually every time is a big hassle.

Up until now (< 6.6.5), we used a dirty hook that changed the JavaScript source helpers.js and overwritten the deeplink generation part. Ugly, really bad practice, but it was a one-liner and it worked.

Now we can’t do that anymore because of this commit by @dpfaffenbauer :

Which is a good thing I guess, as it forces us to find a more clean solution. I am however a bit lost as to how to proceed now, as I have zero experience with FOSJsRoutingBundle that was used.

Can I customize deeplink generation somehow?

Should I write a JS Pimcore extension, hook onto an event (would have to be for documents, assets and dataobjects) and change the deeplink after it’s been generated, or is there any other way?

Thanks!

For anyone interested in this also, I just ended up patching the file using this https://github.com/cweagans/composer-patches package. It’s not ideal, but it’s the best solution I could come up with.