mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
mlanthaler: Bugfix: Make sure *Priority* is set, otherwise an invalid SQL statement will be generated when the page is published (Priority = ).
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41818 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e452de966c
commit
f9c5f25254
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package sapphire
|
||||
* @subpackage core
|
||||
@ -490,6 +491,12 @@ class SiteTree extends DataObject {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If priority is empty or invalid, set it to the default value
|
||||
if(!is_numeric($this->Priority) ||
|
||||
(($this->Priority < 0) || ($this->Priority > 1)))
|
||||
$this->Priority = self::$defaults['Priority'];
|
||||
|
||||
parent::onBeforeWrite();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user