Commit Graph

216 Commits

Author SHA1 Message Date
Ingo Schommer
54811abbd2 MINOR More Translatable unit tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70320 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-18 22:48:45 +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
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
613d13e15d MINOR More Translatable unit tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70140 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-14 04:10:54 +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
Ingo Schommer
080cd5c99f ENHANCEMENT Added basic unit tests to new Translatable API
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70073 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 04:34:45 +00:00
Ingo Schommer
50ab6ced93 ENHANCEMENT Added TranslatableTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69962 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 12:38:50 +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
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
Sam Minnee
d32d4d5204 BUGFIX Fixed whitespace issue in DataObjectTest.yml
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69846 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-07 21:40:36 +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
57f31fb09f ENHANCEMENT Added support for two arguments when calling object-methods with dot notation in templates (see #3292)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69601 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-04 22:20:36 +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
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
Ingo Schommer
5404cd3016 BUGFIX Fixed SiteTreePermissionsTest checking for logged-in users (was using Member->logIn() instead of setting "loggedInAs" on test session)
ENHANCEMENT Added FunctionalTest HTTP GET checks for SiteTreePermissionsTest to check that canView() permissions are actually enforced over HTTP

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66681 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-25 22:36:23 +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
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
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
19a891984f Disabled badly specified test
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66397 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:46:20 +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
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
Sam Minnee
0328ff5c9d Added comment syntax to SS templates: <%-- ... --%>
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65926 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-14 03:43:26 +00:00
Sam Minnee
8da5af457e New test for old URL redirection
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65782 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-13 02:18:12 +00:00
Andrew O'Neil
a6ea78a230 Change back to english on teardown
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65673 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-12 03:11:57 +00:00
Ingo Schommer
5df97fba10 ENHANCEMENT Added CompositeField->fieldPosition()
ENHANCEMENT Supporting recursion into nested sets in FieldSet->insertAfter()/TabSet->insertAfter()/CompositeField->insertAfter()
API CHANGE Deprecated CompositeField->insertBeforeRecursive(), use CompositeField->insertBefore()
ENHANCEMENT Renamed CompositeField->beforeInsert() to CompositeField->onBeforeInsert() to avoid confusion with insertBefore()
ENHANCEMENT Added CompositeFieldTest
ENHANCEMENT Added unit tests for FieldSet->insertBefore()/insertAfter()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65581 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-11 02:35:54 +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
Sam Minnee
648a459060 Ensure that Requirements backend instance is preserved between tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65507 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 01:13:42 +00:00
Sam Minnee
bf5493d703 #2997 - Added <% require %> tag to SSViewer
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65503 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 01:01:55 +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
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
e6c4d32dbc ARCHITECTURE #3034 wakeless: Make Requirements mockable by pushing the meat of the functionality to Requirements_Backend
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65436 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-07 02:06:28 +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
728e691a1a BUGFIX Added SSViwer support for i18n namespaces in templates with <% _t('MyNamespace.MyEntity', ... %>, to work around magically added namespaces from the parsed template file. Those auto-namespaces were logically not working in includes, as the parsing context is always the including template. Legacy support for auto-namespaces is still present due to its high usage.
ENHANCEMENT Added unit tests for i18n template parsing

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65361 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 02:50: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
Ingo Schommer
e57b7651ef ENHANCEMENT Unit tests for Member->inGroup() and Member->inGroups()
ENHANCEMENT Added a "strict-mode" for Member->inGroup() and Member->inGroups() to determine true membership to a group (without inheritance)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65125 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-03 01:57:16 +00:00
Ingo Schommer
8fb4ea1eaa BUGFIX Fixed SearchContextTest to comply to new scaffolded searchfield in Text DBFIeld
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65094 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 21:24:56 +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
5c4403d57e BUGFIX Dont instanciate abstract classes in i18nTextCollector
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65062 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 00:26:34 +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
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
c9da559151 ENHANCEMENT More solid fulltext checks against master language tables in i18nTextCollectorTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65055 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 22:47:02 +00:00
Ingo Schommer
4f1d3913e1 ENHANCEMENT Added unit tests for i18nTextCollector handling of newlines in entity values
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65051 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 18:55:27 +00:00
Ingo Schommer
72de4163b7 ENHANCEMENT Using namespaces for filenames in RequirementsTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65029 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 14:04:31 +00:00
Ingo Schommer
c0c4ff8a9d BUGFIX Fixed CsvBulkLoaderTest to comply to hasHeaderRow API change (r64806)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65026 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 13:47:01 +00:00
Ingo Schommer
ff7a63cc37 MINOR Moved i18n tests into sapphire/tests/i18n subfolder
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65025 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 13:45:04 +00:00
Ingo Schommer
de7ed1aa3a BUGFIX Changed i18nTextCollectorTest to only trigger _t() calls in instance methods (they don't fully work in __construct()). Manually adding ClassInfo state for the fakewebroot needed to test textcollection - ManifestBuilder/ClassInfo currently don't support setting of other webroots, or flexible inclusion/exclusion of certain subfolders which would be necessary to do this without hacks.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65023 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 13:40:00 +00:00