Commit Graph

217 Commits

Author SHA1 Message Date
Normann Lou
c8753a99d3 BUGFIX: Fix the bug in buildSQL() by trying to join an table with non-exsiting composite db field like "Money"
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85120 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-24 23:51:53 +00:00
Sam Minnee
dfbd16e140 BUGFIX: Fixed querying of composite fields (broken due to inappropriate optimisation of hasField)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84796 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-19 04:59:40 +00:00
Sam Minnee
a74129b5a6 ENHANCEMENT: Improved performance of DataObject::hasField()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84165 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-11 08:57:14 +00:00
Sam Minnee
5790ddf708 API CHANGE: Added DataObject::is_composite_field() and DataObject::composite_fields() to efficiently keep track of which fields are composite.
API CHANGE: Deprecated DataObject::databaseFields() in favour of the static DataObject::database_fields()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84161 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-11 08:49:52 +00:00
Sam Minnee
d5cf940d69 API CHANGE: Make Object::uninherited_static() have a separate execution path to Object::get_static(), for more reliable operation. The intention is that for any given static, you either use Object::get_static() or you use Object::uninherited_static() - not both.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84151 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-11 05:01:17 +00:00
Sam Minnee
5f6bee22ba BUGFIX: Added static resetting methods for more reliable test execution.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84147 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-11 04:45:54 +00:00
Sam Minnee
51e28f078c ENHANCEMENT: Improved performance of DataObject::buildSQL(), by caching a suitable interim piece.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@83441 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-31 05:41:59 +00:00
Tom Rix
d5d8cf15f6 MINOR make sure DataObject::setField() can only be pased a scalar, or a DBField.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82486 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-23 00:31:52 +00:00
Ingo Schommer
f233d00072 BUGFIX Fixed missing iteration check in DataObject?->getChangedFields() (merged from branches/2.3-nzct)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82058 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-16 23:47:50 +00:00
Sam Minnee
7f77bc4733 BUGFIX: Removed double-call to augmentSQL in DataObject::get
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80961 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-03 03:45:11 +00:00
Sam Minnee
2b61c12adc BUGFIX #4325: Fixed publishing of empty values by fixing DataObject::forceChange()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80934 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-03 01:21:48 +00:00
Sam Minnee
f41e2b474c ENHANCEMENT: Improved performance of admin/assets area.
BUGFIX: Fixed bug in 'sake interactive' error handling.
BUGFIX: Fixed bugs with MSSQL and Windows support.
API CHANGE: Added FormAction::setButtonContent()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80782 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-01 22:27:18 +00:00
Sam Minnee
0540bec71f BUGFIX #4255 sharvey: Fix application of extra db fields by DataObjectDecorators.
API CHANGE #4255 sharvey: DataObjectDecorator::extraStatics() can no longer refer to $this because it's called staticly


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79430 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-17 07:01:28 +00:00
Sam Minnee
546a5b2c89 ENHANCEMENT: Added better error message if defaults are a bad format.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79382 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-17 02:13:02 +00:00
Sean Harvey
5affa62e6c BUGFIX Made date fixes for MSSQLDatabase more robust in DataObject::__construct()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79375 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-16 23:31:12 +00:00
Sam Minnee
4df21d29e0 BUGFIX: Fixed date field manipulation.
MINOR: Added sorts to TableListFieldTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79327 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-16 04:03:47 +00:00
Sam Minnee
b536ecd610 BUGFIX: Fixed MSSQL date tweak to not accidentally generate default values for dates.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79311 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-16 02:59:36 +00:00
Sam Minnee
add7d31d8b BUGFIX: Fixed Sean's MSSQL date fix to work for both Date and Datetime
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79310 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-16 02:57:22 +00:00
Sean Harvey
46c135c1d8 MINOR Updated note on MSSQLDatabase specific functionality in DataObject::__construct()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78964 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-11 07:54:42 +00:00
Sean Harvey
26606fd01d BUGFIX MSSQLDatabase returns strange formatted Datetime values, removed hacks from DateField and PopupDateTimeField and put it in DataObject::__construct() so that it fixes the problem at the source
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78963 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-11 07:18:10 +00:00
Ingo Schommer
2f020b5c83 MINOR Typo in DataObject->__destroy() (#4210)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78727 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-09 20:42:42 +00:00
Sam Minnee
bdeda543c9 BUGFIX: Don't let $dataObject->ClassName be set to an improper value.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78678 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-09 03:29:24 +00:00
Sam Minnee
b2460de140 ENHANCEMENT: Removed circular references from extensions to improve garbage collection.
API CHANGE: The result of any extension returned by Object::extInstance() should have setOwner() called on it before calling a method, and clearOwner() after.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78414 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-04 06:48:44 +00:00
Sean Harvey
11d6f3c0b0 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78410 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-04 06:20:32 +00:00
Sam Minnee
c542ec0de9 BUGFIX: Prevent infinite recursion in certain object instantiation cases
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78253 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-02 06:08:46 +00:00
Ingo Schommer
8efc00598a MINOR Renamed parameter in DataObject->db() to $fieldName
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78236 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-02 03:45:22 +00:00
Ingo Schommer
634ff10c89 BUGFIX Excluding names of CompositeDBFields from DataObject::custom_database_fields() and including the actually generated columns in CompositeDBField->compositeDatabaseFields(). This is necessary for DataObject->hasField() to work correctly and avoid generated queries with wrong column identifiers
BUGFIX Querying db() in DataObject->hasField() in addition to hasDatabaseField(), as the two might differ when CompositeDBFields are used
MINOR Added DataObjectTest->hasDatabaseField()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78235 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-02 03:43:45 +00:00
Ingo Schommer
173711531e MINOR Reverted r77823, it causes infinite loops whenver DataObject->getField() etc. are used within __construct(). This is the case with Translatable and other modules, and breaks things like schema building
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78121 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-28 23:18:01 +00:00
Ingo Schommer
f7b019bff6 MINOR Improved DataObject->debug() formatting
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77923 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-27 03:22:52 +00:00
Ingo Schommer
30165bd1da BUGFIX Passing $cache parameter from DataObject:.get_by_id() to DataObject::get_one()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77896 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-27 00:33:02 +00:00
Ingo Schommer
dfa44c055c API CHANGE Changing DataObject::$changed to private visiblity. Please use getChangedFields() and isChanged()
ENHANCEMENT Added DataObject->isChanged() to detect if a field has been changed in this object instance
MINOR Changing call to CompositeDBField->compositeDatabaseFields() in DataObject->hasOwnDatabaseField()
BUGFIX Unsettig "Version" property in DataObject->getChangedField() to allow versioned to write a new version after a call to forceChange()
BUGFIX Introduced $markChanged in Money class
BUGFIX Casting Money->__toString() return value as string
MINOR Changing Member class to use new DataObject->isChanged() API
BUGFIX Using new $markChanged API for CompositeDBFields in DBField::create()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77893 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-27 00:09:23 +00:00
Sam Minnee
ccb4916d19 BUGFIX: Ensure that statics are updated by decorators before static variables are interrogated by static methods.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77823 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-26 03:25:51 +00:00
Ingo Schommer
9f7bbc57d0 BUGFIX Inspecting the change status of all CompositeDBFields when invoking DataObject->getChangedFields(), as their value setting is not performed through DataObject->setField(), it doesn't trigger the built-in change detection.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77667 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-23 05:32:16 +00:00
Ingo Schommer
265b4184f7 BUGFIX Fixed DataObject->write() for CompositeDBFields - wasn't calling setValue() on those fields, which meant that CompositeDBFields like Money were overwriting the values set in DataObject::$record (e.g. "MoneyCurrency" for a "Money" field) with empty values through CompositeDBField->addToManipulation(), as the dbfield itself doesn't have any values.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77640 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-22 09:07:08 +00:00
Will Rossiter
cf35533a78 EHANCHMENT: update the regular expression to disregard any underscores directly before a capital letter, as well as using the PCRE functions and adding a small test. PATCH: #4081
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77612 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-22 03:49:15 +00:00
Sean Harvey
e27f41238d API CHANGE Removed @deprecated 2.3 method DataObject::filledOut(): Please use custom code instead for checking values
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77379 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-20 06:22:33 +00:00
Ingo Schommer
4e8735b10e MINOR Marked new $create_table_options API as experimental
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77170 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-19 04:44:33 +00:00
Ingo Schommer
336bce8bf8 ENHANCEMENT Added DataObject::$create_table_options to pass through special options to Database->requireTable(). Contains a keyed array by database driver. Example use is specifying different storage engines for MySQL: array('MySQLDatabase'=>'ENGINE=InnoDB')
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77160 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-19 03:55:14 +00:00
Sean Harvey
161e7a35c7 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77020 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-17 23:15:31 +00:00
Sean Harvey
9ff495188f MINOR Moved protected variables brokenOnWrite and brokenOnDelete to top of DataObject for consistency
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76607 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-12 01:58:45 +00:00
Sam Minnee
ed06eb37c0 BUGFIX: Created Versioned's Version field as a proper Dataobject field.
API CHANGE: DataObject's internal $this->record array doesn't import null values, so that they don't get written back out.
API CHANGE: DataObject queries explicitly list columns, rather than using *.  This means that extraneous columns won't be included.
MINOR: Updated tests for db abstraction.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76372 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-07 06:00:50 +00:00
Ingo Schommer
b4ec97506a BUGFIX Only loading value in a CompositeDBField through DataObject->getField() if either the value exists, or the record was previously saved
ENHANCEMENT Getting composite db field definitions in DataObject->hasOwnTableDatabaseField() when dealing with a CompositeDBField class

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76097 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-05 07:55:46 +00:00
Sean Harvey
13b358a8dd Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75582 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-29 00:07:39 +00:00
Sean Harvey
ec9765d9f2 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75572 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-28 23:40:35 +00:00
Geoff Munn
3022c7a908 Removed Database Abstraction TODO notice
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75291 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-27 21:35:20 +00:00
Ingo Schommer
e55f3126fa BUGFIX Changed DataObject->newClassInstance() to only force changes if a differing classname was set. Setting ClassName property on new instance to trigger change detection (required for Translatable->onBeforeWrite())
BUGFIX Only force DataObject->forceChange() on fields which aren't already marked as changed

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75248 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-27 05:55:25 +00:00
Ingo Schommer
f5d578ff8c BUGFIX Setting Classname and RecordClassname properties on internal $record map when constructing a DataObject without passing $record into it. This ensures that getChangedFields() works on ClassName as well, which is required for Translatable->onBeforeWrite()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75156 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-27 01:36:15 +00:00
Ingo Schommer
d2d04d950a BUGFIX Consistently returning boolean values in DataObject->hasDatabaseField()
MINOR Documentation in DataObject

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73885 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-31 19:34:37 +00:00
Ingo Schommer
b12a00c391 MINOR phpdoc documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73509 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-22 22:59:14 +00:00
Geoff Munn
e76d876b73 API CHANGE: Postgres support for T-search indexes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73249 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-17 22:22:46 +00:00