i upgraded a site to 2.4.0 final and enabledSiteTree::enable_nested_urls(); in my config:
The old 2.3.x non nested urls for nested pages stopped working. While the changelog describes there being a fallback which rewrites the old urlsegment tot the new nested link via 301 header. While in previous beta/ rc of 2.4.0 this used to work just fine.
i traced it back to function 'find_old_page' in ModelasController.php
if(SiteTree::nested_urls()) {
$pages = DataObject::get(
'SiteTree',
"\"URLSegment\" = '$URLSegment'" . ((SiteTree::nested_urls()) ? ' AND "ParentID" = ' . (int)$parentID : '')
);
if($pages && $pages->Count() == 1) return $pages->First();
}
isn't this non functional as there's an if statement checking for SiteTree::nested_urls() while later on a ParentID is always needed as this second check is by default true based on the previous mentioned if statement?
shouldn't the line at read
"\"URLSegment\" = '$URLSegment'" . (($parentID) ? ' AND "ParentID" = ' . (int)$parentID : '')
or could parentID be omitted completely?
Is my pre 2.4.0 implementation somehow gone wrong a bit and for whatever reason not providing a valid parentid to the function here or is this a bug which crawled in at the last minute?
hope this helps...
as a very important sidenote: thanks for 2.4.0 - it looks way way way great!