I just upgraded to 2.4.3 from 2.3.* and, as we know, with the advent of hierarchical URLs, URLSegment can no longer be used as a link since the nesting is not stored in that field. I realize that this was considered bad practice in the first place, but perhaps had I known how to convert a URLSegment TO a Link() in the first place then I wouldn't have done it ;)
That said, let's get to it. I use a lot of custom queries on my site using DB::query() and SQLQuery(). In these queries, the Link() function is meaningless. So I am getting the URLSegment from the SiteTree table and then just using that value as the Link. Now, as stated above, this doesn't work, because these pages are now nested within other parent pages.
I need to know how I can "calculate" the FULL URL from this URLSegment, much like the redirects performed by the MigrateSiteTreeLinkingTask action does. There has to be a method for this, but I haven't found it yet. Any help out there?
Thanks in advance,