Commit Graph

522 Commits

Author SHA1 Message Date
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