mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Using new DBField->isChanged() in VirtualPage and SiteTree
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77914 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4a9b100e31
commit
c1d59185a9
@ -982,7 +982,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
// If there is no URLSegment set, generate one from Title
|
// If there is no URLSegment set, generate one from Title
|
||||||
if((!$this->URLSegment || $this->URLSegment == 'new-page') && $this->Title) {
|
if((!$this->URLSegment || $this->URLSegment == 'new-page') && $this->Title) {
|
||||||
$this->URLSegment = $this->generateURLSegment($this->Title);
|
$this->URLSegment = $this->generateURLSegment($this->Title);
|
||||||
} else if(isset($this->changed['URLSegment']) && $this->changed['URLSegment']) {
|
} else if($this->isChanged('URLSegment')) {
|
||||||
// Make sure the URLSegment is valid for use in a URL
|
// Make sure the URLSegment is valid for use in a URL
|
||||||
$segment = ereg_replace('[^A-Za-z0-9]+','-',$this->URLSegment);
|
$segment = ereg_replace('[^A-Za-z0-9]+','-',$this->URLSegment);
|
||||||
$segment = ereg_replace('-+','-',$segment);
|
$segment = ereg_replace('-+','-',$segment);
|
||||||
@ -1012,7 +1012,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
DataObject::set_context_obj(null);
|
DataObject::set_context_obj(null);
|
||||||
|
|
||||||
// If the URLSegment has been changed, rewrite links
|
// If the URLSegment has been changed, rewrite links
|
||||||
if(isset($this->changed['URLSegment']) && $this->changed['URLSegment']) {
|
if($this->isChanged('URLSegment')) {
|
||||||
if($this->hasMethod('BackLinkTracking')) {
|
if($this->hasMethod('BackLinkTracking')) {
|
||||||
$links = $this->BackLinkTracking();
|
$links = $this->BackLinkTracking();
|
||||||
if($links) {
|
if($links) {
|
||||||
|
@ -100,8 +100,7 @@ class VirtualPage extends Page {
|
|||||||
// Don't do this stuff when we're publishing
|
// Don't do this stuff when we're publishing
|
||||||
if(!$this->extension_instances['Versioned']->migratingVersion) {
|
if(!$this->extension_instances['Versioned']->migratingVersion) {
|
||||||
if(
|
if(
|
||||||
isset($this->changed['CopyContentFromID'])
|
$this->isChanged('CopyContentFromID')
|
||||||
&& $this->changed['CopyContentFromID']
|
|
||||||
&& $this->CopyContentFromID != 0
|
&& $this->CopyContentFromID != 0
|
||||||
&& $this instanceof VirtualPage
|
&& $this instanceof VirtualPage
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user