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;
|
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
|
||||||
Subsite::disable_subsite_filter(true);
|
Subsite::disable_subsite_filter(true);
|
||||||
$candidatePage = DataObject::get_one(
|
$candidatePage = SiteTree::get()->filter([
|
||||||
SiteTree::class,
|
'URLSegment' => urldecode($rest),
|
||||||
"\"URLSegment\" = '"
|
'SubsiteID' => $subsiteID,
|
||||||
. Convert::raw2sql(urldecode($rest))
|
])->first();
|
||||||
. "' AND \"SubsiteID\" = "
|
|
||||||
. $subsiteID,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
Subsite::disable_subsite_filter($origDisableSubsiteFilter);
|
Subsite::disable_subsite_filter($origDisableSubsiteFilter);
|
||||||
|
|
||||||
if ($candidatePage) {
|
if ($candidatePage) {
|
||||||
|
Loading…
Reference in New Issue
Block a user