mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Make sure that CheckboxField sets it's value as either 1 or 0, so that saveInto() saves the proper boolean value
MINOR Added tests for observing the dataValue() and Value() return values based on setting different values to the field git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75046 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
578a53a9cc
commit
8605743ea6
@ -16,6 +16,10 @@ class CheckboxField extends FormField {
|
||||
return ($this->value) ? 1 : 0;
|
||||
}
|
||||
|
||||
function Value() {
|
||||
return ($this->value) ? 1 : 0;
|
||||
}
|
||||
|
||||
function Field() {
|
||||
$attributes = array(
|
||||
'type' => 'checkbox',
|
||||
|
@ -113,14 +113,14 @@ class FormField extends RequestHandler {
|
||||
/**
|
||||
* Returns the field message, used by form validation
|
||||
*/
|
||||
function Message(){
|
||||
function Message() {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the field message type, used by form validation
|
||||
*/
|
||||
function MessageType(){
|
||||
function MessageType() {
|
||||
return $this->messageType;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package sapphire
|
||||
* @subpackage tests
|
||||
*/
|
||||
class CheckboxSetFieldTest extends SapphireTest {
|
||||
|
||||
static $fixture_file = 'sapphire/tests/forms/CheckboxSetFieldTest.yml';
|
||||
|
Loading…
Reference in New Issue
Block a user