Sam Minnee
0821f021cc
API CHANGE: Added DataList::filterByCallback() to allow filtering by PHP code.
2012-06-06 16:12:05 +12:00
Sam Minnee
780f2d2b16
API CHANGE: Added DataQuery::aggregate() to allow for aggregates beyond Min, Max, Avg, Sum.
2012-06-06 16:12:05 +12:00
Sean Harvey
13be7cb2b9
BUGFIX Ensure that enum values with a single quote are escaped correctly for PHP coming out of MySQL ('' to \'), otherwise dev/build shows these as changed all the time.
2012-06-06 10:39:00 +12:00
Fabian Schmengler
afdd8683e4
BUGFIX: Added double quotes to column names in automatically generated indexes for many_many relationships (this time in the right place, should not interfere with index name - all tests pass)
2012-06-05 11:51:04 +02:00
Sam Minnee
5499079c1c
BUGFIX: Fixed ORM bugs introduced in ec554689325765881a83df6f87c34efe80c92961
2012-06-05 11:07:19 +12:00
Sam Minnée
f8921f7c9f
Merge pull request #500 from nyeholt/injector_strong_create
...
RECOMMIT This is a recommit of a previously merged, but reverted, commit...
2012-06-04 15:32:19 -07:00
Sam Minnée
90378b0998
Merge pull request #504 from schmengler/namespace-fixes-rc1
...
BUGFIX: Handling of classes with namespaces in database
2012-06-04 15:31:26 -07:00
Fabian Schmengler
ec55468932
BUGFIX: Handling of classes with namespaces in database
...
MySQLDatabase::enumValuesForField() - Added stripslashes because backslashes are escaped in the type description
DataObject::requireTable() - Added double quotes to column names in automatically generated indexes for many_many relationships
DataObject::write() - Escaped class name for DB query
DataQuery::getFinalisedQuery() - Escaped class names for DB query
2012-06-04 20:22:37 +02:00
Marcus Nyeholt
82a1e7d282
MINOR Use injector for creating Member_GroupSet object
...
MINOR Use injector for creating many many list objects
MINOR Use injector for creating objects from within the DataList
MINOR Use Injector::inst() for creating objects; cannot rely on this->injector being present due to many classes being created with 'new', so use inst() directly
MINOR Remove injector autoset property for now; automatically setting it breaks a few test cases that don't know about it for now, and it's not needed just yet
2012-06-05 01:33:44 +10:00
Marcus Nyeholt
ae7fc6f4d2
RECOMMIT This is a recommit of a previously merged, but reverted, commit. The initial commit had problems when running "tests/all flush=all" when dev/build would re-analyse a bunch of stuff; fixes to address this went into https://github.com/silverstripe/sapphire/pull/487 , but for some reason the actual base changes didn't, so I'm re-submitting them in a separate pull.
...
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
2012-06-03 20:41:00 +10:00
Sean Harvey
c4a1523fac
Merge pull request #465 from halkyon/aggregate_fixes
...
Deprecated aggregates fix
2012-05-30 02:04:36 -07:00
Sean Harvey
909c5bd3b1
MINOR Fixed spelling error
2012-05-29 20:10:34 +12:00
Sean Harvey
f43273f217
MINOR Provide a better error if incorrect number of arguments are passed
...
to filter() or exclude() on a DataList
2012-05-29 20:09:36 +12:00
Sean Harvey
792c89e103
ENHANCEMENT Adding List() in the GenericTemplateGlobalProvider so
...
templates can use <% cached List(Member).max(LastEdited) %> instead
of deprecated "Aggregate" syntax.
2012-05-29 20:04:51 +12:00
Sean Harvey
c3eabffcb9
MINOR Use shorthand {class}::get() syntax instead of DataList::create()
...
in core code.
2012-05-28 21:13:42 +12:00
Sean Harvey
862d7f249b
MINOR If $containerClass passed in to DataObject::get() isn't DataList,
...
use Deprecation::notice() instead of throwing a notice
2012-05-28 21:12:06 +12:00
Sean Harvey
9074f524cc
BUGFIX Fixing regression in Boolean::scaffoldSearchField()
2012-05-24 14:13:55 +12:00
Sam Minnée
c5616f8724
Merge pull request #487 from nyeholt/injector_bugfixes
...
Change singleton and strong_create to use dependency injector, with additional fixes to existing classes to behave correctly
2012-05-23 18:46:48 -07:00
Sean Harvey
1ed5e3c9be
Merge pull request #485 from halkyon/deprecate_director_statics_for_controller
...
Deprecate director controller static functions
2012-05-23 15:54:57 -07: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
Sean Harvey
60c72c40d9
API CHANGE Use of the DropdownField $emptyString argument is now
...
properly deprecated (has been marked as deprecated since 2.3). Please
use setEmptyString() on the DropdownField instance instead.
2012-05-23 22:59:40 +12:00
Sean Harvey
77c2365b87
MINOR Replacing deprecated static function calls to Director with
...
current Controller instance replacements.
2012-05-23 21:50:02 +12:00
Sean Harvey
29e04a1049
Revert "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"
...
This reverts commit 5eaca340b486a2a29d7096220c3d1cabb2d6645f.
2012-05-23 09:52:57 +12:00
Marcus Nyeholt
5eaca340b4
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
2012-05-22 19:09:35 +10:00
Sean Harvey
e5e8f489a2
Merge branch (pull request #247 ) 'template-global-fixes' of https://github.com/sminnee/sapphire into sminnee-template-global-fixes
2012-05-19 15:39:59 +12:00
Yuki Awano
c04b01fc2a
BUGFIX Changed Date.php and DateTime.php to use DateTime->Format instead of strtotime to handle extended dates on 32bit environment( fixes #7311 )
2012-05-18 16:09:38 +09:00
Sam Minnee
7201f06476
API CHANGE: Added new config option Money.default_currency.
2012-05-18 16:15:13 +12:00
Ingo Schommer
8f2ede8fcf
MINOR Fixed syntax errors from SQLQuery/DataQuery cleanup
2012-05-16 13:17:19 +02:00
Ingo Schommer
3a11c690ed
MINOR Updated security documentation (phpdoc and markdown) around new DataList and SQLQuery APIs, additional automatic escaping on some stricter inputs like column names
2012-05-16 11:59:22 +02:00
Ingo Schommer
9326d9e60e
BUGFIX Fixing SQLQuery->getFilter() usage of non-existent method (removed during refactoring of pull request), more accurate deprecation notice
2012-05-15 21:29:43 +02:00
Sean Harvey
b1104dac25
BUGFIX Don't try lazy loading fields when the record ID is set to something non-numeric, otherwise you'll get a SQL error.
2012-05-15 17:18:50 +12:00
Sean Harvey
a53cca8932
MINOR Renaming getFieldSet with getFieldList in FormScaffolder
2012-05-14 15:03:22 +12:00
Sean Harvey
0fe0d87d9f
Merge pull request #434 from halkyon/using_non_deprecated_template_controls
...
Replacing use of deprecated <% control %> with <% with %> or <% loop %> as necessary
2012-05-11 15:08:16 -07:00
Ingo Schommer
13c9011082
Merge pull request #430 from halkyon/getallfields_fixes
...
MINOR Fixing use of deprecated getAllFields(), mark field as deprecated ...
2012-05-11 01:04:38 -07:00
Sean Harvey
6f672e5f36
MINOR Fixing use of <% control %> with <% with %> or <% loop %> as necessary.
2012-05-11 13:49:20 +12:00
Sean Harvey
46f51d5653
MINOR Fixing deprecated use of SQLQuery
2012-05-11 11:39:06 +12:00
Sean Harvey
1859070fa9
MINOR Fixing use of deprecated getAllFields(), mark field as deprecated properly.
2012-05-11 11:23:24 +12:00
Sean Harvey
56e75b4486
MINOR Revert changes for 5.4
2012-05-10 14:11:33 +12:00
Sean Harvey
f30a3bd760
BUGFIX Database::doesSchemaNeedUpdating() if schemaUpdateTransaction is NULL, then return FALSE. If schemaUpdateTransaction is an array, then return TRUE. This replaces the automatic casting which is not clear.
2012-05-10 13:58:29 +12:00
Ingo Schommer
8281678d4c
BUGFIX Urlencode paths in URLSegmentFilter when $allowMultibyte=true to avoid creating invalid URLs (and breaking assumptions based on ascii-only URLs, such as static publishing filename creation)
2012-05-08 15:32:15 +02:00
Ingo Schommer
59d31c2fc2
MINOR Removed mbstring support checks, its an installation requirement
2012-05-08 15:32:15 +02:00
Sean Harvey
7c272d3139
MINOR SQLQuery doc cleanup
2012-05-07 17:11:10 +12:00
Sean Harvey
3bc1da0543
MINOR Tidy up of SQLQuery constructor docs and default args, limit is
...
stored internally as an array, not a string.
2012-05-07 17:07:30 +12:00
Sean Harvey
bb9ffd2eb1
ENHANCEMENT SQLQuery::selectField() returns a SQLQuery object to be
...
consistent with how the other add/set methods work.
MINOR Fixing DbDatetimeTest to use the correct selectField to select an
alias
2012-05-07 16:59:42 +12:00
Sean Harvey
e50f90bf8e
BUGFIX Ensure end bracket for HAVING clause is put in the right place
2012-05-07 16:36:05 +12:00
Sean Harvey
051d9de482
API CHANGE Deprecated internal access to SQLQuery properties, update core code to reflect these changes.
...
Using set/add instead in accessor methods, and use Database::sql*ToString() to allow easier per-database adapter SQL overloading.
2012-05-07 14:21:44 +12:00
Ingo Schommer
68051fdb96
Merge pull request #371 from halkyon/sapphire
...
---
Dont start the session until its actually necessary, which is to say there is a cookie available with the current PHP session name (or a request variable with the session_name() - typically PHPSESSID.) The latter allows for passing session ID through as an alternative to cookies.
2012-05-03 14:58:09 +02:00
Sean Harvey
37369abf1d
BUGFIX Fixing SortColumn alias to be recognised by MSSQL/PGSQL
2012-05-03 12:02:21 +12:00
Sean Harvey
151abde17d
Merge pull request #388 from chillu/trac/7170-i18n-sprintf-injections
...
#7170 i18n sprintf injections
2012-05-02 16:18:30 -07:00
Sam Minnée
a004acfb59
Merge pull request #381 from AngryPHPNerd/patch-2
...
MINOR: Colliding field check runs twice
2012-05-02 14:14:40 -07:00