Commit Graph

587 Commits

Author SHA1 Message Date
Sean Harvey
0b9db33164 BUGFIX MySQLDatabase->decimal() was being casted as an integer, when in actual fact the precision could be "9,2", for example
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71891 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-16 03:42:37 +00:00
Sean Harvey
0f1cf8899a BUGFIX Fixed calls to undefined function in Hierarchy. Should have been calling a property of the same name instead
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71838 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-14 03:02:16 +00:00
Sean Harvey
0ca4177e3b ENHANCEMENT Added getValue() to DBField. This helps for unit testing DBField values.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71833 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-13 09:30:32 +00:00
Geoff Munn
040913369d API CHANGE: The standard ID column is now database-specific
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71824 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-13 02:37:58 +00:00
Sean Harvey
7a065b087a ENHANCEMENT Strip tags before limiting characters when using LimitCharacters() on HTMLText field type
MINOR Added test to TextTest for LimitCharacters()
MINOR Added test HTMLTextTest and added test case for LimitCharacters()



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71795 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-12 09:38:43 +00:00
Sean Harvey
1d121b7f90 ENHANCEMENT Allow setting date timestamp for Date::setValue()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71786 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-12 04:57:17 +00:00
Sean Harvey
569447d2ba BUGFIX Added E_USER_ERROR error to ComponentSet::getExtraData() if a NULL component name is passed
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71640 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-11 00:18:00 +00:00
Sean Harvey
1cb6b5c8ee BUGFIX Added E_USER_ERROR error to ComponentSet::getExtraData() if a non-numeric child ID is passed
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71639 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-11 00:14:42 +00:00
Sean Harvey
df36ae07e8 ENHANCEMENT Allow getting extra field data for a many-to-many relation by calling getExtraData() on a ComponentSet and passing the component name, and child ID
ENHANCEMENT Hooked up setting field values for many_many_extraFields into ComplexTableField. See r71613 for the original many-to-many auto setting addition
BUGFIX When editing an existing record, many-to-many auto setting wasn't being done because saveComplexTableField() is called on ComplexTableField_ItemRequest
 


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71635 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-11 00:10:37 +00:00
Sean Harvey
bbe3bc0535 MINOR Code formatting of ComponentSet::add()
MINOR Removed unused variable $id in ComponentSet::add()



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71615 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-10 06:21:08 +00:00
Sean Harvey
fa4c42d642 ENHANCEMENT Allow auto setting a many-to-many relation on ComplexTableField in the similar fashion of auto setting the foreign key for a one-to-many or one-to-many relation.
ENHANCEMENT Added DataObject::many_many_extraFields() for getting the many_many_extraFields fields for a component name on both sides of a many-to-many relation.
MINOR Added test for many_many_extraFields in DataObjectTest



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71613 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-10 06:04:36 +00:00
Sean Harvey
bf07ed2d87 MINOR Code formatting for Date::past_date() and phpDoc
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71611 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-10 05:56:07 +00:00
Geoff Munn
5312773e18 'URLSegment' on line 484 and 494 now escaped
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71567 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-10 00:49:16 +00:00
Ingo Schommer
5513f569b6 BUGFIX Including Hierarchy->children in flushCache() and renamed to _cache_children. This caused problems in TranslatableTest when re-using the same SiteTree->Children() method with different languages on the same object (even with calling flushCache() inbetween the calls)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71340 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-04 01:36:12 +00:00
Sean Harvey
162a11350e MINOR Added code example for using DataObject::$many_many_extraFields
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71305 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-03 21:07:32 +00:00
Sean Harvey
b3ffe8d4e2 MINOR Code formatting tidy up in Percentage
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71301 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-03 20:29:21 +00:00
Sean Harvey
2f81c822bb BUGFIX: Fix translatable being enabled when it shouldn't be
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71258 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-03 02:49:34 +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
2956cc482f FEATURE Supporting search for special characters like umlauts in SearchForm. These characters are encoded to HTML entities by TinyMCE for SiteTree->Content, hence we need a special case in the search logic (incl. unit tests)
ENHANCEMENT Added MySQL FULLTEXT index for $Content property on SiteTree, Needs separate indexing to be searchable by SearchForm - $Content is the only field which has special characters encoded as HTML entities (through TinyMCE)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70328 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-19 02:49:42 +00:00
Ingo Schommer
7057b56b2c ENHANCEMENT Making ErrorPage static HTML files translatable (#2233)
ENHANCEMENT Added ErrorPage::$static_filepath to flexibly set location of static error pages (defaults to /assets)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70326 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-19 01:25:23 +00:00
Ingo Schommer
56cb10e1c5 BUGFIX Altering parent getCMSFields() results in RedirectorPage instead of starting with an empty FieldSet, as this discards any tabs and fields which are not explicitly mentioned in the implementation like the ability to create a translation.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70325 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-19 00:33:43 +00:00
Ingo Schommer
84a7b17cb4 ENHANCEMENT Disabled Translatab-e>augmentWrite() - was only needed for the blacklist fields implementation which is inactive for the moment
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70319 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-18 22:47:02 +00:00
Ingo Schommer
33066bffda BUGFIX Reverted special cases for Translatable in Versioned->canBeVersioned() (originally committed in r42119) - was checking for existence of underscores in table names as an indication of the "_lang" suffix, which is no longer needed. It was also a flawed assumption which tripped over classes like TranslatableTest_TestPage
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70318 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-18 22:46:16 +00:00
Ingo Schommer
bcac495926 ENHANCEMENT Recursively creating translations for parent pages to ensure that a translated page is still accessible by traversing the tree, e.g. in "cms translation mode" (in Translatable->onBeforeWrite())
ENHANCEMENT Simplified AllChildrenIncludingDeleted() to not require a special augmentAllChildrenIncludingDeleted() implementation: We don't combine untranslated/translated children any longer (which was used in CMS tree view), but rather just show translated records
ENHANCEMENT Ensuring uniqueness of URL segments by appending "-<langcode>" to new translations (in Translatable->onBeforeWrite())
ENHANCEMENT Added Translatable->alternateGetByUrl() as a hook into SiteTree::get_by_url()
ENHANCEMENT Adding link back to original page in CMS editform for translations
BUGFIX Excluding HiddenField instances from Translatable->updateCMSFields()
BUGFIX Don't require a record to be written (through exists()) when checking Translatable->isTranslation() or Translatable->hasTranslation()
MINOR Don't use createMethod() shortcut for Translatable->AllChildrenIncludingDeleted()
MINOR Added Translatable unit tests

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70306 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-16 04:14:34 +00:00
Ingo Schommer
7ccd1bbc24 ENHANCEMENT Looking for URLSegments in languages outside of default language in ModelAsController by implementing a new extension point in SiteTree::get_by_url(): DataObjectDecorator->alternativeMatches()
ENHANCEMENT Allowing non-default language URLs to be accessed without explicitly specifying the language in GET request

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70305 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-16 04:07:17 +00:00
Ingo Schommer
c67ef43f6c MINOR initializing local variables properly in Hierarchy
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70304 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-16 04:04:13 +00:00
Ingo Schommer
d5339af47c BUGFIX Falling back to Translatable::current_lang() if no $context object is given, in augmentAllChildrenIncludingDeleted() and AllChildrenIncludingDeleted()
MINOR phpdoc for Translatable
MINOR Added more Translatable unit tests

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70214 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-15 05:56:25 +00:00
Ingo Schommer
42fd02234d ENHANCEMENT Added Hierarchy->flushCache() to clear in-memory caches for allChildrenIncludingDeleted() and allChildren()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70213 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-15 05:54:10 +00:00
Ingo Schommer
5c1c90320d MINOR documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70139 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-14 04:10:37 +00:00
Ingo Schommer
cb8308513b BUGFIX Disabled assumption that SQLQuery->filtersOnID() should only kick in when exactly one WHERE clause is given - this is very fragile and hard to test. It would return TRUE on $where = "SiteTree.ID = 5", but not on $where = array("Lang = 'de'", "SiteTree.ID = 5")
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70138 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-14 04:00:30 +00:00
Andrew O'Neil
196286a6c2 Fix typo
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70134 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-14 02:32:35 +00:00
Ingo Schommer
455ee11b5a API CHANGE Removed obsolete Translatable::table_exists()
ENHANCEMENT Made Translatable constructor arguments optional, as by default all database fields are marked translatable
MINOR More unit tests for Translatable

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70118 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 22:28:24 +00:00
Andrew O'Neil
aca51f68bc BUGFIX: Fix default language not being set
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70079 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 05:02:43 +00:00
Andrew O'Neil
2b6842e634 BUGFIX: Fixed URLs having to unique across languages
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70078 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 05:02:11 +00:00
Ingo Schommer
00619a02f9 API CHANGE Removed obsolete internal Translatable methods: hasOwnTranslatableFields(), allFieldsInTable()
ENHANCEMENT Removed $create flag in Translatable::getTranslation() and replaced with explit action createTranslation()
ENHANCEMENT Sorting return array of Translatable::getTranslatedLangs()
ENHANCEMENT Added a note about saving a page before creating a translation
MINOR Added phpdoc to Translatable

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70072 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 04:34:27 +00:00
Ingo Schommer
59f6133655 MINOR Added empty $db static on GhostPage - was causing weird side-effects when reinitializing decorated $db statics through Translatable
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70071 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 04:31:14 +00:00
Andrew O'Neil
4c0227e105 #3340 - Add extra date functions
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69974 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-12 02:02:45 +00:00
Saophalkun Ponlu
824726c3f5 BUGFIX Allowing to pass direct ALTER TABLE notation into Database->requireField() as a fallback from array-syntax. This is necessary for external modules like gis which cant hook into core database abstraction routines. Specifically, the GeoPoint implementation broke /dev/build
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69971 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-11 22:20:51 +00:00
Ingo Schommer
1c40434a67 BUGFIX Fixed SQL quoting in Translatable
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69961 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 12:38:37 +00:00
Ingo Schommer
d3d6ae833d Merged, debugged and enhanced Translatable patches from branches/translatable at r64523, r64523, 64523, thanks wakeless!
API CHANGE Changed Translatable schema from auxilliary tables (SiteTree_lang, SiteTree_lang_Live) to automatically filtered records on the original table (SiteTree, SiteTree_Live), using $Lang and $OriginalID properties. Incompatible update to old schema, migration script is in the works.
API CHANGE Removed Translatable::get_one(), Translatable::write()
ENHANCEMENT Simplified Translatable tree generation by using getSiteTreeFor() in CMSMain->createtranslation()
ENHANCEMENT Added AllChildrenIncludingDeleted(), augmentNumChildrenCountQuery(),  augmentAllChildrenIncludingDeleted(), augmentStageChildren() to Translatable class to allow for more stable tree generation.
ENHANCEMENT Moved definition of Translatable schema from augmentDatabase() to Translatable->extraStatics()
ENHANCEMENT Changes to the CMS language selection refresh the whole admin interface instead of the tree only. This way we can add a URL parameter ?lang=<lang> to /admin, which makes the specific language bookmarkable and reloadable. Changes to LangSelector.js
ENHANCEMENT Added fallback to ModelAsController->getNestedController() to fetch page with matching URLSegment but different language in case no page is found in the current language.
ENHANCEMENT Added helper methods to Translatable: getTranslation(), hasTranslation(), isTranslation(), findOriginalIDs()
ENHANCEMENT Getters and setters for Translatable->getOriginalPage() etc.
ENHANCEMENT Hooking Translatable into ModelAsController and ContentController initialization in order to call choose_site_lang()
ENHANCEMENT Simplified Translatable->augmentSQL(), augmentWrite() by not using auxilliary tables
ENHANCEMENT Showing clickable links for Translations in Translatable->updateCMSFields()
BUGFIX Modifying Hierarchy/SiteTree Children getters to accept optional "context" which can be used to set a language explicitly through the $Lang property, rather than implicitly reyling on the static Translatable::current_lang()
BUGFIX Fixed TranslatableTest to work with new datamodel
BUGFIX Temporarily disabled cookie/session selection in Translatable::choose_site_lang() until we have a good test suite for the side effects.
MINOR Added "untranslated" CSS styles to tree nodes and marking them as inactive/grey


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69959 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 12:15:30 +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
c8200f67ac BUGFIX Fixed SiteTree->getIsDeletedFromStage() to return false on non-numeric IDs (isNew())
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69857 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-07 23:01:38 +00:00
Ingo Schommer
0747fc6d52 MINOR merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69856 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-07 23:00:54 +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
c4250635bc BUGFIX Disabling batch selection of pages without publication rights in SiteTree->CMSTreeClasses()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69747 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-06 02:46:16 +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
40215a9937 ENHANCEMENT Removed object state setting in CMSMain/SiteTree publication process: DeletedFromStage, CheckedPublicationDifferences, IsAddedToStage and added getters for them. Improves testability as we don't have to rely on random methods like MenuTitle() being called to set object state.
ENHANCEMENT Flushing cache in SiteTree->onAfterWrite() and SiteTree->onAfterDelete() to ensure the publication state is up to date


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69410 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-17 22:41:07 +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
Geoff Munn
fe0a640c39 API CHANGE: fulltext and unique indexes are now arrays
API CHANGE: db/build now no longer notifies you of changes which haven't actually happened.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69303 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-17 00:40:24 +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
0a017da580 BUGFIX Added stub PDODatabase implementations to avoid errors when batch-instanciating singletons
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@68166 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-10 07:33:27 +00:00
Ingo Schommer
9e145705bc MINOR Merged r68155 from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@68164 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-10 07:28:04 +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
Andrew O'Neil
17e855da88 BUGFIX: Fix incomplete change in r66672
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@67152 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-02 04:32:19 +00:00
Sam Minnee
3a13be7703 BUGFIX: Fixed db/build comparison for enum values
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@67076 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-01 05:03:34 +00:00
Sam Minnee
d76638249e BUGFIX: Access tab - include 'inherit' in the option lists on top level pages if that is the current value. Otherwise you try and save a null which MySQL can cope with but stricter databases can't.
BUGFIX: Fixed posgresql syntax for tree-sort publishing.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66794 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-27 00:06:35 +00:00
Sam Minnee
1ad0bfb165 Improved boolean field handling for postgres
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66792 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-27 00:00:35 +00:00
Ingo Schommer
47a67a5a4e BUGFIX Wrong usage of Member::currentUser() in SiteTree->canEdit()
ENHANCEMENT Allowing to explicitly check SiteTree->can*() actions for a non-existing member without triggering Member::currentUser() fallback for better testability

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66672 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-25 22:23:47 +00:00
Ingo Schommer
aa7b5f4ee3 MINOR merged from branches/2.3 (googlesitemaps modularization)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66517 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 22:04:32 +00:00
Sam Minnee
75a237cd01 BUGFIX: Fixed SQLQuery::filtersOnId
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66509 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 19:48:11 +00:00
Sam Minnee
2e955b498e BUGFIX: Fixing tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66508 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 19:28:46 +00:00
Sam Minnee
96c5be8252 Updating queries to be more DB agnostic
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66507 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 09:31:14 +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
08e9e04f1a BUGFIX: Fixed access to changed format for SQLQuery::
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66425 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:26:38 +00:00
Sam Minnee
d2d22aa2d7 Updated boolean SQL value generation to be more db-agnostic
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66423 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:20:43 +00:00
Sam Minnee
5a98e83f7a API CHANGE: Updated DB::manipulate() to be more db-agnostic.
API CHANGE: Moved the meat of SQLQuery's SQL generation into Database::sqlQueryToString(), to be overloaded by different database implementations.
API CHANGE: Moved the implementation of ClassInfo::hasTable() and ClassInfo::getValidSubClasses() into Database::hasTable() and Database::enumValuesForField(), to be overloaded by different database implementations.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66422 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:20:02 +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
a3d3fb65a9 Updated SQL queries to be ansi compatable
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66401 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 00:31:06 +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
ece0130baa Merged pre-2.3-oct08
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66352 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-21 01:06:21 +00:00
Sam Minnee
4e6036911e Merged branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66112 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-18 01:52:32 +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
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
91c0ca0755 BUGFIX Adjusted Translatable to api changes from r65581
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65583 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-11 02:37:01 +00:00
Ingo Schommer
79a7e6d27a ENHANCEMENT Using actual classname in DataObjectSet->debug()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65582 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-11 02:36:30 +00:00
Sam Minnee
9565fec5ad FEATURE #2767 wakeless: Allow popuplation of non-DataObject tables with YamlFixture
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65555 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 23:18:31 +00:00
Ingo Schommer
5c9f0f120b BUGFIX Setting correct user locale in ImageField and FileIframeField - the controller is separate from the CMS context, so wasn't initialized with i18n (see #1727)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65539 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 19:54:30 +00:00
Ingo Schommer
5d9550c214 BUGFIX Making Metadata fields writeable in translation mode (see #2993)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65536 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 11:11:13 +00:00
Sam Minnee
58dbe416ee Merged from branches/2.2
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65523 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 03:51:35 +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
4452e9bb5b ENHANCEMENT Updated UpgradeSiteTreePermissionSchemaTask to rename obsolete database columns
ENHANCEMENT Calling UpgradeSiteTreePermissionSchemaTask from SiteTree->requireDefaultRecords as a temporary workaround for missing migration infrastructure. This means that upgrading the schema for 2.3 can be done without manual task triggers, just the usual dev/build (see http://open.silverstripe.com/ticket/2847#comment:4)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65495 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-09 23:58:48 +00:00
Ingo Schommer
117806756c ENHANCEMENT Added Database->renameField() and Database->dontRequireField()
ENHANCEMENT Added DatabaseTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65494 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-09 23:56:24 +00:00
Ingo Schommer
e6a95566d9 MINOR Removed obsolete code from MySQLDatabase
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65484 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-09 23:21:16 +00:00
Sam Minnee
4f6170c265 BUGFIX: Better initial-site-setup boundary condition checking needed after the manifest builder update
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65469 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-09 22:11:25 +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
Sam Minnee
5a0db59850 BUGFIX: Fixed broken dev/build compilation of manifest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65394 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 20:57:07 +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
Ingo Schommer
ccd149f689 BUGFIX Reverted text replacement performance improvement in SQLQuery - it was replacing more ocurrences via str_replace() than the previous implementation based on arrays, which broke queries augmented by Translatable (originally committed in r60468 and r54044)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65291 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-05 14:23:17 +00:00
Sam Minnee
33219fcad2 BUGFIX #2954 - Fixed support for negative numbers in decimal fields
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65269 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-05 04:10:48 +00:00
Will Rossiter
bb20921fef BUGFIX: fixed canPublish() so it actually got the member if none was passed and fixed notice with $results not existing
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65242 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-05 01:05:57 +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
ca6d92341e API CHANGE Changed SiteTree->Viewers to SiteTree->CanViewType, Changed SiteTree->Editors to SiteTree->CanEditType (see #2847)
API CHANGE Changed SiteTree->ViewersGroup has_one relationship to SiteTree->ViewerGroups has_many relationship (see #2847)
API CHANGE Changed SiteTree->EditorsGroup has_one relationship to SiteTree->EditorGroups has_many relationship (see #2847)
ENHANCEMENT Added 'Inherit' flag to SiteTree->CanViewType and SiteTree->CanEditType (see #2419)
ENHANCEMENT Added unit tests for SiteTree permissions
BUGFIX Checking recursively for permissions on children with SiteTree->canDelete()
BUGFIX Disallow SiteTree->canEdit() if SiteTree->canView() is not granted
Note: Use dev/tasks/UpgradeSiteTreePermissionSchemaTask/run to migrate legacy data to the new schema as outlined above

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65150 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-03 14:52:35 +00:00
Sam Minnee
c573d51d4c BUGFIX: Fixed bug with ID-less generation of YamlFixture entries that trigger $this->write() in setters
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65123 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-03 01:28:18 +00:00
Ingo Schommer
65d5cf088f ENHANCEMENT Scaffolding TextField instead of TextareaField in Text DBField due to size
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65092 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 21:07:09 +00:00