Commit Graph

25 Commits

Author SHA1 Message Date
ARNHOE
47f5235f94 MINOR: Forgot Apostrophe in comment 2012-11-29 12:12:26 +01:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Damian Mooyman
cd7ea01bd1 FIXED: Minor adjustment to order of file fulltext search fields. By matching the order of these index columns to the same as the fields on the table itself, this will prevent the unnecessary regeneration of fulltext indexes on some database connectors each dev/build, notably MS SQL Server. 2012-09-25 12:31:50 +12:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Damian Mooyman
30e15d11a7 FIXED: Generation of tables with fulltext indexes now no longer incorrectly thinks that all fulltext indexes have changed.
ADDED: Test cases correctly checking for changes (and no changes) to the data model for both fields and indexes.
FIXED: References to indexes throughough the code that probably should have quoted field names. This prevents a lot of 'spam' during dev build. This includes an updated FulltextSearchable test case.
2012-09-11 12:53:08 +12:00
Hamish Friedlander
fa37c448a5 API Reverse config extra statics control flow
Config system used to provide an add_static_source method, which was intended for
use by Extensions to add statics. But extensions for a class arent initialised
until at least one instance of that class is created, so before that the
Config system didnt include values from extensions

This patch reverses the control flow, so that the Config system explictly asks
each Object for its additional config sources via the new method
get_extra_config_sources. This method returns an array that can contain
string names of classes and also raw associative arrays.

The developer visible change is that Extension#add_to_class has been
deprecated. Instead there is a new method, get_extra_config, which has
the same method signature but needs to guarantee that it doesnt
cause side effects. Additionally there is no need to call
parent::get_extra_config - this is handled automatically.
2012-08-23 09:29:13 +12:00
Marcus Nyeholt
82495f5a7e BUGFIX Versioned's constructor doesn't provide suitable defaults. Previously a bug/feature in singleton, where it would pass null,true as params to strong_create, which would then get passed through as params to Versioned's constructor, meant that the code still executed fine (as was set to something that wasn't an array, so the null and true were instead taken as args). The fact that the usage of singleton(Versioned) never really used the classes code, purely for value lookup, meant that this never propagated errors. I've now switched singleton() to use the injector for retrieving values, which means these dud values are no longer passed through
CHANGE Given that Config::inst is an implementation of the singleton pattern itself, I've removed the extra call to singleton(). A side effect of this is that it gets around a possibly nasty circular reference with the dependency injector (which relies on the config object); in future, this dependency structure should really be structured from the DI directly.

MINOR Change singleton and strong_create to use dependency injector

BUGFIX: Provide default constructor values for classes (fixes issues when used in 'singleton' scenario during dev/build in particular)

MINOR Clear out injector state when resetting db schema during tests (a follow on from changing singleton() calls to use the injector underneath)
2012-05-23 21:10:04 +10:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Sean Harvey
41433f1211 BUGFIX Fixing FulltextSearchable and Hierarchy to conform to the parent DataExtension for E_STRICT compliance. 2012-04-12 12:06:02 +12:00
Sean Harvey
ec02ab6f68 BUGFIX Fixed FulltextSearchable checking DB::getConn() unncessarily for
MySQL, as Database::requireTable() will only apply create_table_options
to the database adapter they're set for. Replace Object::add_static_var
usage (deprecated) with the new config system instead.
2012-03-25 20:38:29 +13:00
Sean Harvey
f63497d6f9 ENHANCEMENT Extension arguments are now passed through to add_to_class()
static function on Extension classes.
BUGFIX FulltextSearchable didn't pass through arguments, use now
available $args parameter with FulltextSearchable::add_to_class()
2012-03-12 16:14:47 +13:00
Ingo Schommer
719bb18db8 MINOR Added documentation about the new File.ShowInSearch property 2011-12-03 12:01:23 +01:00
Stig Lindqvist
260a9e230c BUGFIX Versioned returns error on singleton($className)->summaryFields()
This solves a bugfix when calling singleton($className)->summaryFields() and Versioned kicks back. It is needed to by the GridField functionality to get default columns to show.

This is due to DataExtension calls ClassName::extraStatics() when calling ::load_extra_statics() statically, we need to pass in class and extension.
2011-10-31 11:17:37 +13:00
Simon Welsh
28c97325a3 BUGFIX: Removes duplicate create_table_options that caused preg_match() to fail in PHP 5.2. 2011-10-29 17:12:02 +13:00
Will Rossiter
3c16af3aca Merge pull request #92 from simonwelsh/fulltextsearch-fix
BUGFIX fulltext fixes.
2011-10-28 21:00:42 -07:00
Simon Welsh
25602811f2 BUGFIX: FulltextSearchable::enable() needs to replace the static on the decorated class iff the database engine is for MySQL 2011-10-29 16:57:16 +13:00
Simon Welsh
82da8a0718 Only set the create_table_options value when enabling FulltextSearch 2011-10-29 15:24:06 +13:00
ajshort
3a1c2df4e7 API CHANGE: Renamed DataObjectDecorator to DataExtension.
API CHANGE: Renamed LeftAndMainDecorator to LeftAndMainExtension.
MINOR: Replaced all references to decorators with extension.
2011-04-26 11:01:38 +10:00
Ingo Schommer
0d39a888a1 MINOR Removed references to ContentController from documentatin 2011-03-29 18:20:14 +13:00
Ingo Schommer
a9b13509d2 MINOR Removed dependency on SiteTree in various unit tests 2011-03-29 18:07:58 +13:00
Paul Meyrick
dc36725869 MINOR Using BlankPage template in SecurityTest, BasicAuthTest to remove ContentController dependency
MINOR Checking for SiteTree class existence in Security, Translatable
MINOR Checking for ContentController existence in FulltextSearchable
MINOR Removed unnecessary ContentController tests from ObjectTest
MINOR Replaced CMS specific examples in PermissionCheckboxSetFieldTest, DataObjectTest
MINOR Changed SecurityTest to make assertions against Security/login rather than relying on redirection from admin/cms
2011-03-29 18:07:55 +13:00
Sam Minnee
6449e3a1a7 MINOR Added FulltextSearchable::get_searchable_classes() in order to introspect currently searchable classes, added FulltextSearchableTest, added documentation (from r111789)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112923 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 04:53:36 +00:00
Sam Minnee
dd1c02cd90 BUGFIX: Search didn't respect searchableClasses passed to FulltextSearchable::enable() (from r111464)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112905 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 03:54:51 +00:00
Sam Minnee
2948bc1c64 MINOR: Misc merges from branches/2.4
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112142 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-13 03:53:12 +00:00
Sam Minnee
368033942c API CHANGE Changed MySQLFulltextSearchable class to FulltextSearchable (applies to all databases) (from r102012)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112056 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-13 01:26:51 +00:00