mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Fix "Column 'URLSegment' in where clause is ambiguous" when duplicating pages
This commit is contained in:
parent
831c3c3cbe
commit
f1fce6f739
@ -484,14 +484,10 @@ class SiteTreeSubsites extends DataExtension
|
||||
|
||||
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
|
||||
Subsite::disable_subsite_filter(true);
|
||||
$candidatePage = DataObject::get_one(
|
||||
SiteTree::class,
|
||||
"\"URLSegment\" = '"
|
||||
. Convert::raw2sql(urldecode($rest))
|
||||
. "' AND \"SubsiteID\" = "
|
||||
. $subsiteID,
|
||||
false
|
||||
);
|
||||
$candidatePage = SiteTree::get()->filter([
|
||||
'URLSegment' => urldecode($rest),
|
||||
'SubsiteID' => $subsiteID,
|
||||
])->first();
|
||||
Subsite::disable_subsite_filter($origDisableSubsiteFilter);
|
||||
|
||||
if ($candidatePage) {
|
||||
|
Loading…
Reference in New Issue
Block a user