Skip to content

Commit

Permalink
Fixes silverstripe#139 - Broken URL Segment CMS Links
Browse files Browse the repository at this point in the history
Fixes issue silverstripe#139 using normann's solution that seems to work perfectly with both long and short links.
  • Loading branch information
James Cocker committed Jun 4, 2014
1 parent 2a6c913 commit 38e4bc1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions code/extensions/SiteTreeSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ function updateCMSFields(FieldList $fields) {
($nested_urls_enabled && $this->owner->ParentID ? $this->owner->Parent()->RelativeLink(true) : null)
);

$url = (strlen($baseLink) > 36 ? "..." .substr($baseLink, -32) : $baseLink);

$urlsegment = $fields->dataFieldByName('URLSegment');
$urlsegment->setURLPrefix($url);
$urlsegment->setURLPrefix($baseLink);
}
}

Expand Down

0 comments on commit 38e4bc1

Please sign in to comment.