Commit Graph

2176 Commits

Author SHA1 Message Date
Andrew O'Neil
c86971c93f #2328 - Show backtrace for uncaught exceptions (ajshort)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70444 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-20 21:30:12 +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
4c4926d2b9 FEATURE Enabled specifying a language through a hidden field in SearchForm which limits the search to pages in this language (incl. unit tests)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70327 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-19 02:18:41 +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
095084fb22 BUGFIX Using array_diff_key() instead of array_diff() in LanguageDropdownField to avoid language with existing translations showing up in the "available translations" dropdown for page CMS fields
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70321 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-18 23:07:51 +00:00
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
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
e39f4f747a ENHANCEMENT Added welsh to i18n::$common_languages (#2640)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70317 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-18 21:30:10 +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
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
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
Ingo Schommer
696934582f MINOR Updated translations
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70113 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 22:05:15 +00:00
Andrew O'Neil
4f42548da6 BUGFIX: Fix translatable migration regenerating URLSegments when it shouldn't
BUGFIX: Fix translatable migration not writing records to Live properly


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70080 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 05:04:21 +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
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
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
84c03e35d9 Add translation migration task
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70033 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-13 01:03:41 +00:00
Ingo Schommer
0fdc2cd8c6 MINOR Updated language master tables
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70016 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-12 05:08:59 +00:00
Ingo Schommer
58638c142e MINOR Changed visibility of i18n::get_owner_module() to public (used in CMSMenu class)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70015 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-12 05:08:21 +00:00
Ingo Schommer
6f6e72135c ENHANCEMENT Added Japanese translation (Thanks Hiroki, Daisuke, Fijii, Shiva, Daniel and Minoru!)
MINOR Updated translations

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69999 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-12 04:38:07 +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
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
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
690f982a69 MINOR removed debug code from i18n
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69960 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 12:17:42 +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
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
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
a16825d9a3 ENHANCEMENT Added support for custom CSS classes to Form (similiar to FormField implementation) through Form->addExtraClass()
MINOR Improved formatting and readability of Form->FormAttributes()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69742 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-06 02:16: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
Saophalkun Ponlu
a32a79e816 MINOR: fixed some alignments
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69685 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-05 03:06:57 +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
Saophalkun Ponlu
11d0491abf IMPROVEMENT: image alignment options. ticket #1877
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69557 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-19 13:36:59 +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