Commit Graph

67 Commits

Author SHA1 Message Date
Damian Mooyman
7368deca8f
BUG Fix issue with SS_List as datasource for dropdown field
BUG Fix validation issue with CheckboxSetField
Fixes #6166
2016-10-11 14:58:48 +13:00
Damian Mooyman
b0ba2015d9 [ss-2016-015] Fix value / title escaping in CheckboxSetField and OptionsetField 2016-08-15 15:53:21 +12:00
Ed Chipman
4aa1fc2d2c BUGFIX: Changed form fields that call renderWith in Field() to call parent::Field() instead (#5783) 2016-07-07 19:55:37 +01:00
Damian Mooyman
1d122803cc Merge remote-tracking branch 'origin/3.1' into 3.2
Conflicts:
	dev/SapphireTest.php
	docs/en/02_Developer_Guides/01_Templates/01_Syntax.md
	forms/DatetimeField.php
	forms/NullableField.php
	forms/NumericField.php
	forms/gridfield/GridField.php
	tests/control/DirectorTest.php
	tests/model/DataObjectSchemaGenerationTest.php
	tests/model/MySQLDatabaseTest.php
2015-06-19 10:48:07 +12:00
Stewart Wilson
9421374f91 check to ensure $values is not null or empty before exploding. Otherwise, return an empty array 2015-06-05 21:21:37 +10:00
Stevie Mayhew
9e8a5c9ba5 FIX: remove validation type constraint from form fields for 3.2 release 2015-05-11 12:32:00 +12:00
Damian Mooyman
dff65867cc Merge remote-tracking branch 'origin/3.1' into 3
Conflicts:
	control/HTTP.php
	control/HTTPResponse.php
	docs/en/05_Contributing/01_Code.md
	forms/CompositeField.php
	forms/FormAction.php
	forms/FormField.php
	forms/InlineFormAction.php
	forms/NumericField.php
	forms/TreeDropdownField.php
	forms/TreeMultiselectField.php
	templates/forms/TreeDropdownField.ss
	tests/core/CoreTest.php
	tests/forms/NumericFieldTest.php
	tests/model/DataDifferencerTest.php
2015-02-20 10:17:19 +13:00
Phill Price
907944cdf3 Update CheckboxSetField.php
Updated example to work in api - as DropdownField does.
2015-02-17 10:05:27 +00:00
Stevie Mayhew
41ea83b337 FEATURE: add validation to form field subclasses 2014-11-17 08:17:38 +13:00
Damian Mooyman
eb069e605d Remove all redundant whitespace 2014-08-19 09:17:15 +12:00
Will Rossiter
5a14b7227c Moved checkboxset option list generation to separate method
This allows subclasses and extensions time to modify the list of options and their configuration without having to override the entire Field method.

A more flexible way to implement silverstripe#3311
2014-07-25 11:27:14 +12:00
Will Rossiter
e7266535c5 FIX: Allow empty checkboxes through setValue(null) (#1392) 2014-01-12 17:28:09 +13:00
Simon Welsh
151baeede1 Correct line length and indentation 2013-08-21 18:54:05 +12:00
Daniel Hensby
4e36020118 BUG UnsavedRelationList aren't checked
When saveInto is called on ListboxField and CheckboxsetField,
UnsavedRelationList should be an acceptable relationship type. This is
leading to relations not being saved on initial creation of Member
objects
2013-02-19 14:58:31 +00:00
Ingo Schommer
559abecd56 API Copying instance props on FormField readonly/disabled transformations
Introduced new FormField->castedCopy() method
which tries to replicate the existing form field instance
as closely as possible.

Primarily, the fix was targeted at consistently passing
through FormField->description to all of its variations.
2012-12-14 01:58:04 +01:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Sean Harvey
3f68e6f82f BUGFIX Ensure that a single string value (as opposed to an array of
values) is accepted by implode() in CheckboxSetField by casting it
as an array.
2012-06-11 13:41:02 +12:00
Simon Welsh
3a6341a251 API-CHANGE sapphire folder can now be renamed. 2012-04-15 10:50:19 +12:00
Will Rossiter
07d2d5273a ENHANCEMENT: populate FormField:: on the fly based on class name of field rather than requiring explict definition. 2012-04-14 17:36:19 +12:00
Andrew O'Neil
daab8f4cbc MINOR: Consistently use DataObjectInterface for saveInto() on FormField subclasses. Fixes E_STRICT notice 2012-04-11 17:00:57 +12:00
Andrew O'Neil
f811103243 MINOR: Remove redundant setDisabled() methods - this method already exists in FormField. Fixes E_STRICT notice. 2012-04-11 16:17:44 +12:00
Ingo Schommer
b43bdf3781 BUGFIX Allowing to save ListboxField and CheckboxSetField into custom relations (which don't return TRUE for has_many() or many_many()) 2012-03-07 01:23:41 +01:00
Ingo Schommer
344899ab77 Revert "ENHANCEMENT Support numeric array values in CheckboxSetField (?Field[]=val1&Field[]=val2 instead of ?Field[val1]=1&Field[val2]=1)" - data handling with numeric/associative arrays too clumsy, fixed up ListboxField instead
This reverts commit 8fa266462f.
2012-03-05 10:55:44 +01:00
Ingo Schommer
8fa266462f ENHANCEMENT Support numeric array values in CheckboxSetField (?Field[]=val1&Field[]=val2 instead of ?Field[val1]=1&Field[val2]=1) 2012-03-02 20:46:22 +01:00
Ingo Schommer
7602d081a2 ENHANCEMENT Fluent interface in Form API by returning instance from all setters 2012-02-17 13:35:26 +01:00
Ingo Schommer
eb5716f471 MINOR Using instanceof rather than is_a in CheckboxSetField 2012-01-02 16:49:33 +01:00
Ingo Schommer
b5421d9598 ENHANCEMENT Allowing custom attributes in (most) FormField implementations, which allows for HTML5 data attributes 2012-01-02 16:48:14 +01:00
Ingo Schommer
a6148c33da MERGE Using FormField->template in most fields 2012-01-02 16:48:14 +01:00
Sean Harvey
9e548f501e API CHANGE FormField::Field() and FormField::FieldHolder() now render into templates on each FormField instead of creating HTML from PHP 2012-01-02 16:48:13 +01:00
ajshort
6aa90e6288 MINOR: Replaced is_a with instanceof to fix bugs with the changed is_a behaviour in PHP 5.3.7. 2011-12-26 18:31:32 +11:00
Stig Lindqvist
e38dd08ea5 MINOR: Fix docblocks to reference SS_List instead of (now deprecated) DataObjectSet where appropriate 2011-10-28 15:58:55 +13:00
Will Rossiter
1732a17114 Merged new-orm into datagrid 2011-09-26 16:47:54 +13:00
Ingo Schommer
ce8e72cf0e MINOR Removing executable flag from all files (thanks miiihi) 2011-09-18 22:04:02 +02:00
Sam Minnee
de1494e3a8 ENHANCEMENT: Implemented DataList as the successor of DataObjectSet. DataList doesn't execute the query until it's actually needed, allowing for a more flexible ORM.
API CHANGE: augmentSQL is now passed a DataQuery object from which query parameters can be extracted.
API CHANGE: DataObjectDecorators that manipulate the query can now define augmentDataQueryCreation().
API CHANGE: The container class argument for DataObject::get() is deprecated.
API CHANGE: DataObject::buildSQL() and DataObject::extendedSQL() are deprecated; just use DataObject::get() now.
API CHANGE: DataObject::instance_get() and DataObject::instance_get_one() are deprecated, and can no longer be overloaded.
API CHANGE: DataObject::buildDataObjectSet() is deprecated.
API CHANGE: Cant't call manual manipulation methods on DataList such as insertFirst()
2011-05-01 15:25:45 +12:00
Sam Minnee
3388642d6b MINOR Fixed documentation in CheckboxSetField (fixes #6068, thanks paradigmincarnate) (from r111788)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112922 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 04:53:24 +00:00
Ingo Schommer
a191019e7a MINOR Documentation (from r104404)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112345 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 00:04:14 +00:00
Ingo Schommer
93895a4f0f ENHANCEMENT Added OptionsetField->setDisabledItems() to allow specifically disabling certain checkboxes
ENHANCEMENT Added CheckboxSetField->setDefaultItems() to tick specified checkboxes regardless of the value passed

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@99596 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-02-22 06:11:58 +00:00
Ingo Schommer
233a8fcd85 BUGFIX: was being passed to foreach without a check to see if it's an array or not. (from r86202)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90834 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-05 00:29:21 +00:00
Sean Harvey
e343391bfe MINOR Fixed invalid argument foreach() on CheckboxSetField
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89342 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-17 23:33:13 +00:00
Sam Minnee
5082cd8ffb MINOR removed debugging statement (from r88627)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89184 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 22:24:35 +00:00
Sam Minnee
3965ac5237 MINOR don't show invalid version links (from r88147)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89181 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 22:24:09 +00:00
Ingo Schommer
47db2ab55e BUGFIX Detecting DataObjectSet for readonly transformations in CheckboxSetField (thanks martijn, #4527)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85758 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-05 00:05:02 +00:00
Sam Minnee
c52f67aae5 MINOR ajshort: Replaced usage of the deprecated split() function with preg_split().
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79568 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-18 09:34:17 +00:00
Andrew O'Neil
60f75c5ca4 Merged changes from 2.3 branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71172 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-01 23:49:53 +00:00
Ingo Schommer
d26f08b481 MINOR merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@67465 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-04 22:38:32 +00:00
Sam Minnee
73a075a491 FEATURE #594: Added javascript-on-demand support
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65688 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-12 04:31:33 +00:00
Ingo Schommer
9371f4688b ENHANCEMENT Introduced constants for system paths like /sapphire in preparation for a more flexible directory reorganisation. Instead of hardcoding your path, please use the following constants: BASE_PATH, BASE_URL, SAPPHIRE_DIR, SAPPHIRE_PATH, CMS_DIR, CMS_PATH, THIRDPARTY_DIR, THIRDPARTY_PATH, ASSETS_DIR, ASSETS_PATH, THEMES_DIR, THEMES_PATH
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63154 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-09-27 16:02:38 +00:00
Sam Minnee
a6577d9749 Fixed bug with preivous CheckboxSetField change
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62648 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-09-18 03:16:03 +00:00