Commit Graph

547 Commits

Author SHA1 Message Date
Ingo Schommer d8499a24d0
NEW NullDatabase (#10016)
* NEW DatabaselessKernel to support operation without DB

This is required for GraphQL code generation in CI (without a working runtime database/webserver environment).
Context: https://github.com/silverstripe/silverstripe-graphql/issues/388

* New --no-database option for sake

* Refactor to abstract class

* Apply feedback peer review

Co-authored-by: Aaron Carlino <unclecheese@leftandmain.com>
Co-authored-by: Maxime Rainville <maxime@silverstripe.com>
2022-02-04 10:07:27 +13:00
LiamKearn ce3e07a189
DOC DBComposite reword to make a little more sense. (#10193)
* Docs: DBComposite reword to make a little more sense.
* Update src/ORM/FieldType/DBComposite.php
Docs: Rewording DBComposite explanation based on feedback
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2022-01-18 15:52:01 +13:00
Mojmir Fendek 3db1435df7
NEW: Allow DateTime to be immutable (#10125)
* BUG: Datetime modify() returns a new field instance.
* PR fixes.
* PR fixes.
2022-01-18 09:41:11 +13:00
Nicolaas / Sunn Side Up d1cac485b7
ENH Speed up DataObject::get_by_id by checking if there is an ID at all 2022-01-17 09:45:56 +13:00
Michal Kleiner dee0b1faf4
Merge pull request #10020 from GuySartorelli/patch-4
FIX Remove limits in removeAll method
2022-01-15 10:42:19 +13:00
Michal Kleiner 645e1f14bd
Merge pull request #10173 from GuySartorelli/patch-2
FIX Allow custom SELECT to be used for sorting in DataQuery::column()
2021-12-14 10:23:48 +13:00
GuySartorelli 0b0c13764b FIX allow custom SELECT to be used for sorting in DataQuery::column().
If a custom select clause (using special features such as `CASE`) is used, and it was added using `SQLSelect::selectField`, the custom select clause should be retained when calling DataQuery::column().
2021-12-14 08:01:02 +13:00
Lukas 552cf5944d
MNT Fix various typos with codespell (#10177) 2021-12-13 21:05:33 +13:00
Maxime Rainville 27d7c2fe85
Merge pull request #9749 from gurucomkz/patch-9453-mysql8-ints
FIX Don't use int width for mysql >= 8.0.17 #9453
2021-12-13 12:39:12 +13:00
Thomas Portelange 97ab957de8
ENH Use ::create to get DropdownField instance in DBEnum (#10175)
This allows using alternate dropdown implementation.
2021-12-11 20:12:07 +13:00
Sergey Shevchenko 9e2d661689 FIX: Make MySQLSchemaManager::shouldUseIntegerWidth() private 2021-12-08 11:19:47 +13:00
Sergey Shevchenko e68e65badc feat: added config value to force certain behaviour & added a note to the docs 2021-12-08 11:18:00 +13:00
Sergey Shevchenko 2c9ba8bc45 fix: conform with linter 2021-12-08 11:18:00 +13:00
Sergey Shevchenko 62725a5db3 fix: added exception for MariaDB 2021-12-08 11:18:00 +13:00
Sergey Shevchenko 5e26757a9e
Merge branch 'silverstripe:4' into 4 2021-11-15 22:07:11 +13:00
Loz Calver 20134e6a4f
NEW Add FirstPage() and LastPage() to PaginatedList (#10129) 2021-11-08 09:26:21 +13:00
Sergey Shevchenko 04b7ad51b8
Merge branch 'silverstripe:4' into 4 2021-11-01 13:12:59 +13:00
GuySartorelli 059d8aac0a
NEW Add afterUpdateCMSFields method to DataObject. (#9819) 2021-10-26 16:05:11 +13:00
Mo Alsharaf 2c1ef4df23
MNT Update URL in docs for ICU documentation (#10118) 2021-10-15 11:28:16 +13:00
Michal Kleiner 38fe326262 MNT Fix minor typos 2021-09-25 00:23:43 +12:00
Michal Kleiner 1e5414eac7 FIX Use correct ancestor class when querying for stage and live children
The right ancestor class that has the Hierarchy extension applied needs to be used
since it doesn’t have to be the class directly extending from DataObject, which means
the ID and ParentID columns might be in different tables.
2021-09-25 00:23:43 +12:00
Matt Peel f99ba5d716 NEW Add extension point to DataObject->hydrate() 2021-08-25 16:07:02 +12:00
GuySartorelli cacd762357
Avoid "new" keyword to instantiate CompositeValidator
The CompositeValidator is Injectable, so we should allow project code to replace it here via the Injector.
2021-08-02 12:46:53 +12:00
GuySartorelli 5699db306d
FIX: Remove limits in removeAll method.
Keeping a limit here results in a DatabaseException "This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'"
2021-07-12 17:14:46 +12:00
Steve Boyd f6e8d6e591 Merge branch '4.8' into 4 2021-07-07 14:03:02 +12:00
Steve Boyd 87d076faa6 FIX Cast DBInt value to int 2021-07-06 16:43:54 +12:00
Steve Boyd 8e803bbcfc FIX Parse Enums with dots in their values 2021-07-01 16:00:08 +12:00
Steve Boyd 9463aaf571 Merge branch '4.8' into 4 2021-06-08 11:49:01 +12:00
David Peck 28b5b803be FIX Defensively copy mocked datetime 2021-06-05 16:46:19 +12:00
Michal Kleiner 2017a20433 FIX Use empty array as a fallback for preg_split within dbtext summary
If the content is invalid for whatever reason e.g. when instantiating
a DBText field to get a summary of text through
`DBField::create_field('Text', $content)->Summary(10)`, preg_split returns
false and the rest of the code expects an array.
This tweak ensures an array is always returned even when preg_split fails.
2021-06-02 15:17:58 +12:00
Steve Boyd a3df66860f Merge branch '4.8' into 4 2021-05-31 17:05:11 +12:00
Steve Boyd 9ccdb8efb2 Merge branch '4.7' into 4.8 2021-05-31 17:04:54 +12:00
Maxime Rainville 472fc4ebb4
BUG Update DataQuery::exists to return false when limit causes no result to be returned (#9946)
* BUG Update DataQuery::exists to return false when limit causes no result to be returned

* Update comment

* Fixing linting issue
2021-05-31 16:50:58 +12:00
Sam Minnee c7c6bdebdf FIX: Allow join-object to be referenced as a component
This avoids having arbitrary differences between a join object and a
has-one relation.
2021-05-20 20:32:25 +12:00
Maxime Rainville 6fc25e4e96
RFC Add chunk method to DataList to iterate over large dataset (#8940) 2021-04-14 07:49:44 +12:00
Nicolaas 2ecd8b34ee
adding use SilverStripe\Security\Member; to make sure linting works
adding `use SilverStripe\Security\Member;` to make sure that linting works.
2021-04-01 23:36:36 +13:00
Nicolaas 504e20320e
Update DBBoolean.php (#9893) 2021-03-24 12:05:33 +13:00
Joe Harvey 33365b92f3 Bug Fix - Ensure DataQuery::exists() SQL is both valid MySQL and T-SQL
The original SQL statement is not valid T-SQL for use with SQL Server
2021-02-08 17:22:20 +00:00
Maxime Rainville 9ca33950a2
API Add a CREATE_MEMORY_HYDRATED option to DataObject constructor (#9767) 2021-01-21 14:07:06 +13:00
3Dgoo d1cca0f3fb
Fix DataQuery::exists() not working correctly
Fixes `DataQuery::exists()` not working correctly in some cases as discussed in #9809
2021-01-20 17:03:36 -08:00
Steve Boyd ed5c1488c8
Merge pull request #9817 from creative-commoners/pulls/4/fix-dbcomposite-indexspecs
FIX DBComposite getIndexSpecs method
2021-01-17 11:18:35 +13:00
Ingo Schommer 6153f441ee Merge branch 'phpdoc-fixes' into 4 2021-01-14 11:08:22 +13:00
Serge Latyntcev 2f64667bd6 FIX DBComposite getIndexSpecs method using self API to get the list of db fields 2021-01-07 16:19:54 +13:00
3Dgoo 3b74c2596f
Fix DataQuery::exists() not working correctly
Fixes `DataQuery::exists()` not working correctly in some cases as discussed in #9809
2020-12-29 16:45:58 +10:30
William Desportes c932d7e7fb
Fix the phpdoc blocks 2020-12-21 22:23:23 +01:00
Steve Boyd 5be045f9a2 FIX Bug when specifying 0 in ArrayList::offsetSet 2020-12-15 14:50:10 +13:00
Steve Boyd af933e8226 MNT Double quote yaml string, fix phpcs warnings 2020-11-30 11:37:35 +13:00
Guy Marriott b0762593da
Merge branch '4.6' into 4.7 2020-11-17 15:46:54 -08:00
Damian Mooyman 5d45bbdd0d
Update src/ORM/DatabaseAdmin.php
Co-authored-by: Guy Marriott <guy.the.person@gmail.com>
2020-11-13 11:48:50 +13:00
Damian Mooyman 2753516783
Fail over if calling deprecated method 2020-11-13 08:27:53 +13:00