Commit Graph

159 Commits

Author SHA1 Message Date
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
b7d394008e MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69957 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 11:35:50 +00:00
Ingo Schommer
fcda174ea2 BUGFIX Fixed DataObject->merge() behaviour when merging grandchildren classes of DataObject - was using customDatabaseFields() to merge only the db fields on specific class. Changed to inheritedDatabaseFields() and added unit test.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69801 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-07 01:25:43 +00:00
Ingo Schommer
085346f0e0 MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69704 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-05 06:19:48 +00:00
Ingo Schommer
bc430a96df ENHANCEMENT Added Versioned::get_versionnumber_by_stage() (used in new CMSMain/SiteTree state checking)
ENHANCEMENT Added Versioned->flushCache() to empty get_versionnumber_by_stage() caches
ENHANCEMENT Making DataObject->flushCache() decoratable

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69409 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-17 22:38:47 +00:00
Sam Minnee
a8dca3908e Static caching merges from dnc branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@68900 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-15 01:30:41 +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
09e3145921 Fixed reading of booleans in postgres
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66432 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:49:25 +00:00
Sam Minnee
93438e0be2 API CHANGE: Adding double quotes to all table and field references (a work in progress)
API CHANGE: DataObject::get()'s GROUP BY clause is only generated for MySQL as it needs to be improved for other databases to accept it.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66427 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:28:16 +00:00
Sam Minnee
c7330dd231 Introduced array-based syntax for specifying field types (Merged branches/dbabs into trunk)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66403 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 01:01:03 +00:00
Sam Minnee
12e62c6329 ENHANCEMENT: Change MySQLDatabase connection to operate in ANSI SQL mode, to ease the transition to DB abstraction
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66399 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:51:04 +00:00
Sam Minnee
2984355f43 Merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66395 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:33:00 +00:00
Sam Minnee
5df7237a93 Fixed DataObject::hasDatabaseField() for built-in fields (Created, etc)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66110 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-18 01:49:29 +00:00
Sam Minnee
3d9532db83 Merged branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66108 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-18 01:48:37 +00:00
Will Rossiter
8052c5dce4 Merged pre-2.3-oct08 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66080 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-17 22:59:17 +00:00
Ingo Schommer
9c9a461d67 BUGFIX Removed project-specific hack in DataObject->getManyManyComponentsQuery() as it was breaking Translatable saving
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65518 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 02:36:21 +00:00
Ingo Schommer
137b76e271 API CHANGE Deprecated DataObjectDecorator->augmentBeforeWrite(), use DataObjectDecorator->onBeforeWrite()
API CHANGE Deprecated DataObjectDecorator->augmentPopulateDefaults(), use DataObjectDecorator->populateDefaults()
API CHANGE Deprecated DataObjectDecorator->augmentDefaultRecords(), use DataObjectDecorator->requireDefaultRecords()
API CHANGE Deprecated DataObjectDecorator->alternateCan(), use DataObjectDecorator->can()
API CHANGE Deprecated DataObjectDecorator->alternateCanAddChildren(), use DataObjectDecorator->canAddChildren()
API CHANGE Deprecated DataObjectDecorator->alternateCanView(), use DataObjectDecorator->canView()
API CHANGE Deprecated DataObjectDecorator->alternateCanDelete(), use DataObjectDecorator->canDelete()
API CHANGE Deprecated DataObjectDecorator->alternateCanEdit(), use DataObjectDecorator->canEdit()
API CHANGE Deprecated DataObjectDecorator->alternateCanCreate(), use DataObjectDecorator->canCreate()
ENHANCEMENT Added DataObject->onAfterDelete() and DataObjectDecorator->onAfterDelete()
ENHANCEMENT Added stub methods to DataObjectDecorator for documentation purposes

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65453 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-07 12:18:35 +00:00
Normann Lou
2b0add5c72 APICHANGE: make DataObject::getField() visible to the public
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65388 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 06:32:05 +00:00
Sam Minnee
c1d6e82248 API CHANGE: Removed manifest's dependency on database, by removing hastable information [17:47:04]
dquote> API CHANGE: Deprecate ClassInfo::ready() in favour of Security::database_is_ready()
dquote> API CHANGE: Create DataObject::has_own_table() to determine whether a DataObject has a table without looking at it.
dquote> API CHANGE: Exclude /tests/ directories from the manifest entirely except when tests are being run.
dquote> API CHANGE: Added ?usetestmanifest=1 flag to access the test manifest outside of test execution.
dquote> API CHANGE: Simplified Core.php manifest include to just call ManifestBuilder::include_manifest() - manifest takes care of its own cache file

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65385 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 04:51:25 +00:00
Sam Minnee
5f177b9f08 BUGFIX #2056: Removed all references to deprecated Member::isAdmin()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65232 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-04 23:31:33 +00:00
Sam Minnee
72d90ab270 Set default edit rights on pages to be only administrators
API CHANGE: Use return value of alternateCanPublish()
BUGFIX: Fixed the Link() value for homepage
BUGFIX: Allow DBField::__construct() without a name
API CAHNGE: Allow augmentPopulateDefaults on data object decorators

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65229 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-04 23:17:14 +00:00
Ingo Schommer
eb4c950655 BUGFIX Reverted auto-detection of i18n statics like $db in DataObject through provideI18nEntities() - was getting too complicated with decorated properties. Overload DataObject->fieldLabels() or DataObjectDecorator->updateFieldLabels() instead
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65071 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 20:01:49 +00:00
Ingo Schommer
09564b0132 API CHANGE Renamed DataObjectDecorator->loadExtraDBFields() to loadExtraStatics()
API CHANGE Renamed DataObjectDecorator->extraDBFields() to extraStatics()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65065 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 00:36:57 +00:00
Ingo Schommer
f06ae18409 API CHANGE Moved DataObject::get_by_url() to SiteTree::get_by_url()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65060 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 00:24:23 +00:00
Ingo Schommer
d19dd96793 API CHANGE Marked DataObject->filledOut() deprecated
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65059 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 00:17:39 +00:00
Ingo Schommer
d102a902b9 BUGFIX Collecting i18n entities for decorators separately from the decorated classes, as decorated properties like $db have to be stored in the module of the decorated, not in the module of the decorated class.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65057 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 23:16:45 +00:00
Ingo Schommer
4ecb895b0a ENHANCEMENT Added i18nEntityProvider interface (see comments in #1625) incl. unit tests
MINOR documentation for i18nTextCollector

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65022 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 13:26:08 +00:00
Ingo Schommer
7239db8c1b ENHANCEMENT Allowing translation of some static properties on DataObject and subclasses through DataObject->fieldLabels(). Part of the provideI18nEntities() work which was started in r64881 (see #1625)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65020 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 13:23:38 +00:00
Sam Minnee
672ca89c0b API CHANGE #2698 ajshort: URL handler only passes control to subclasses of RequestHandlingData
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64951 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-30 21:51:59 +00:00
Ingo Schommer
84db28eb10 FEATURE Collect i18n Entities from dynamic PHP code - useful to translate statics. Added DataObject->provideI18nEntities() and i18nTextCollector->collectFromEntityProviders(). See #1625
FEATURE Making DataObject attributes translatable through i18n class, e.g. $db and all relation statics. Use DataObject->fieldLabels() to access translated attributes.
ENHANCEMENT Ignoring entity-names with $ signs (most likely dynamic properties) in i18nTextCollector->collectFromCode()


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64881 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-29 21:07:17 +00:00
Normann Lou
27a868ebf2 APICHANGE: add updateFieldLabels() to DataObjectDecorator, so as that a dataobject could update fieldLables by its decorator.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64805 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-28 03:03:16 +00:00
Normann Lou
bff5942338 BUGFIX: Fix YamlFixture issues when specifying IDs
BUGFIX: Fix DataObject::write() with a specified ID and forceInsert to be true

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64798 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-28 01:23:41 +00:00
Ingo Schommer
9b1db223ce API CHANGE Removed deprecated Datetime class, use SSDatetime instead (was conflicting with PHP 5.2 integrated classes)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64394 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 08:59:40 +00:00
Ingo Schommer
62861b091b API CHANGE Removed DataObject->getLastWriteFields(), use DataObject->getChangedFields()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64375 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 08:37:10 +00:00
Sean Harvey
050321cb3c MINOR Removed Group_Unsecure which was never used
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64369 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 05:43:57 +00:00
Ingo Schommer
5865fd19d1 MINOR fixed php notice error in DataObject
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64319 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-15 22:57:33 +00:00
Ingo Schommer
a24ccecb69 FEATURE Added ForeignKey and used it in relation- and databasefield getters in DataObject
FEATURE Added FormScaffolder for more flexible scaffolding of FieldSets from DataObject metadata
API CHANGE Removed DataObject->addScaffoldRelationFields(), now in separate class FormScaffolder
API CHANGE Changed parameters for DataObject->scaffoldSearchFields() to unify them with scaffoldFormFields()
API CHANGE Added optional $params parameter to DataObject->getCMSFields() to be passed on to scaffoldFormFields()
API CHANGE Renamed DataObject->getFormFields() to getFrontEndFields()
ENHANCEMENT Added $params parameter to all DBField->scaffoldFormField() subclasses
API CHANGE Added third optional parameter $object to DBField::create() to comply with ForeignKey and PrimaryKey constructors

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64157 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-13 22:20:41 +00:00
Ingo Schommer
8cc5625708 ENHANCEMENT Ability to add title constructor arguments to Tab and TabSet classes to resolve i18n issues with untranslated or unreferencable Tabs (see #2359)
ENHANCEMENT Support for $field_labels in relation tabs created by DataObject->addScaffoldRelationFields()
ENHANCEMENT Type checking and user errors for Tab and TabSet constructor arguments
ENHANCEMENT Supporting titles in FieldSet->findOrMakeTab()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64073 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-10 16:00:50 +00:00
Ingo Schommer
5f50fee5e9 BUGFIX Making sure that DataObject->has*Field() methods always return an array, in order not to fail any array_key_exists() checks
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64000 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-09 14:39:24 +00:00
Ingo Schommer
b1b909103e BUGFIX Fixing DataObject->hasField() to find fields in inherited database tables by using hasDatabaseField().
BUGFIX Fixing DataObject->hasField() to detect dynamic getters by using hasMethod("get$fieldName") 
ENHANCEMENT Re-enabled two test cases in DataObjectSet as a result of the above fixes 


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63999 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-09 14:38:46 +00:00
Hayden Smith
3f6a86738b Added PHP doc for the ValidationException thrown by DataObject::write
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63892 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-08 20:50:28 +00:00
Hayden Smith
fc2c16efdf DataObject::write now throws a ValidationException rather than calling user_error if the call to DataObject::validate fails. This allows the validation exception to be caught and handled by tests or other controllers.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63891 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-08 20:42:09 +00:00
Sean Harvey
9f0718f6df BUGFIX: Fixed array_key_exists check in DataObject->setField that was failing when DataObject->record was not yet initialised by DataObject->setField.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63813 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-08 02:25:26 +00:00
Hayden Smith
634ed7b70c Merged from branches/nzct-trunk. Use 'svn log -c <changeset> -g' for full commit message. Merge includes stability fixes and minor refactor of TableListField and ComplexTableField.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63806 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-08 02:00:12 +00:00
Sam Minnee
09cbef9146 BUGFIX: Fixed bug in getCMSFields scaffolding of relations
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63739 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-07 04:03:24 +00:00
Ingo Schommer
e1e2329c90 ENHANCEMENT Consistently allowing for $restrictFields and $fieldClasses parameters passed to DataObject->scaffoldFormFields(), DataObject->scaffoldSearchFields(), DataObject->scaffoldCMSFields()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63651 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-05 19:22:54 +00:00
Ingo Schommer
7da3497668 ENHANCEMENT Using DataObject->Title for has_one dropdowns generated in DataObject->scaffoldFormFields()
MINOR Removed scaffolded header field in DataObject->scaffoldFormFields()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63632 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-03 22:47:06 +00:00
Ingo Schommer
df199ebc2b ENHANCEMENT Added DataObject->scaffoldCMSFields() to simplify overloading of getCMSFields(). scaffoldCMSFields() automatically converts scaffoldFormFields() to a tabset
ENHANCEMENT Added DataObject->fieldLabel() and removed $fieldname parameter from DataObject->fieldLabels($fieldName) to simplify overloading of fieldLabels() for i18n

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63630 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-03 18:38:52 +00:00
Ingo Schommer
02ae284e10 FEATURE Added DataObject->getFormFields() - uses DataObject->scaffoldFormFields() by default. Added DataObjectDecorator->updateFormFields() for easy customization
ENHANCEMENT Calling DataObjectDecorator->updateCMSFields() in DataObject->getCMSFields() - was previously only called in SiteTree instances

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63623 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-03 16:21:09 +00:00
Ingo Schommer
1307d3da41 BUGFIX Making sure that Dataobject->getManyManyJoin() inserts a valid database table for the relation - not all component classes returned by ComponentSet->ownerClass are valid tables (see r54797 and r60909 for previous commits on this issue)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63621 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-03 16:11:46 +00:00