Commit Graph

320 Commits

Author SHA1 Message Date
Steve Boyd
3aa6d590a1 MNT Fix unit test 2023-07-11 10:25:16 +12:00
Guy Sartorelli
5854ce6190
Merge branch '4.13' into 5.0 2023-07-10 14:29:03 +12:00
Dylan Wagstaff
8c3ba81052
FIX PHP 8.1 support in MySQLiConnector::query errors (#10570)
* FIX PHP 8.1 support in MySQLiConnector::query errors

The default error reporting mode in PHP 8.1 has changed from using
errors reported on the connection handle to throwing
mysqli_sql_exception. query() makes no allowance for this, and
functions up the call stack expect to catch
Silverstripe\ORM\Connect\DatabaseException instead - resulting in the
MySQLi exception going all the way up to halt the system.

We can use a try, catch, and finally to retain backwards compatibility,
no matter which setting (e.g. PHP version default) someone has enabled.

* Move MySQLConnector test skip call into setUp()

As review feedback; marking the test as skipped in a private function
obfuscated where the call was happening and made it harder to skimread
the tests. Moving this into a setUp function makes it obvious the check
is run before each test case, and skipped if necessary.
2023-07-07 15:56:31 +12:00
Guy Sartorelli
612f7e734f
FIX Allow repeated iterations of predicated query result (#10857) 2023-07-05 16:25:58 +12:00
Guy Sartorelli
fb7d2256f1
Merge branch '4.13' into 5.0 2023-06-22 11:18:46 +12:00
Sabina Talipova
ad9df97626 FIX LastPage method returns true if TotalPages equals 0 2023-06-22 10:50:41 +12:00
Steve Boyd
9f250cf772 MNT Remove references to PDO 2023-03-16 10:59:34 +13:00
Guy Sartorelli
e3a94b9d10
FIX Ensure getters and setters are respected (#10708) 2023-03-01 15:19:07 +13:00
Steve Boyd
0075bf6e49 NEW Access dynamic data inside ViewableData 2023-02-22 09:40:27 +13:00
Maxime Rainville
8c396eb1f6 MNT Remove bad PHPDoc comments on test 2023-02-17 18:53:42 +13:00
Maxime Rainville
7bc4c9dbc3 MNT Tweak some test to account for slightly different sorting logic in PostgreSQL 2023-02-17 18:47:20 +13:00
Maxime Rainville
fc6c45df57 MNT Add test to SQLSelect for Zero limit 2023-01-27 10:00:56 +13:00
Maxime Rainville
5090f49ecc MNT Add more test coverage to DataList::limit() 2023-01-27 10:00:56 +13:00
Maxime Rainville
d1e0e1e305 ENH Make limit method return no results when zero is provided 2023-01-27 10:00:41 +13:00
Maxime Rainville
944722f34f API Removed #[\ReturnTypeWillChange] annotations 2023-01-26 18:10:05 +13:00
Steve Boyd
77301408d8 MNT Remove legacy upgrader config 2023-01-20 17:05:41 +13:00
Guy Sartorelli
b784e243de
Merge pull request #10538 from xini/feature-5-trailing-slash-config-and-redirect
SS5: add trailing slash config and redirect
2023-01-20 15:24:45 +13:00
Florian Thoma
fbcf7dc3e7
API Normalise trailing slashes for all paths
NOTE: There will be additional related PRs required for at least
silverstripe/cms and silverstripe/admin.

Co-authored-by: Guy Sartorelli <guy.sartorelli@silverstripe.com>
2023-01-20 10:31:14 +13:00
Maxime Rainville
b6b0bcea9f Merge branch '4' into 5 2023-01-18 22:16:45 +13:00
Steve Boyd
c1a773310d ENH PHP 8.2 support 2022-12-21 14:44:47 +13:00
Guy Sartorelli
0d662ba95f
Merge branch '4.12' into 4 2022-12-19 01:38:09 +00:00
Sabina Talipova
53c0147f11
API Remove deprecated code (#10594) 2022-12-08 10:44:47 +13:00
Steve Boyd
ae4d7fa090 API Create orderBy() method to handle raw SQL 2022-12-07 12:25:58 +13:00
Guy Sartorelli
8bb712a461
Merge branch '4.11' into 4.12-release 2022-11-30 10:54:02 +13:00
Michal Kleiner
b107622400
FIX Improve rounding logic for storing of long decimal numbers (#10593)
Co-authored-by: Michal Kleiner <michal.kleiner@cub3.com>
2022-11-29 15:07:56 +13:00
Sabina Talipova
a52c7795c7 Merge branch '4' into 5 2022-11-22 11:41:53 +13:00
Steve Boyd
137ebcebec API Stop using deprecated API 2022-11-15 18:20:54 +13:00
Guy Sartorelli
e140c3786c
FIX Ensure consistent behaviour with repeat iterations 2022-09-15 16:22:48 +12:00
Guy Sartorelli
d9be52579d
MNT Fix test 2022-09-15 13:29:29 +12:00
Loz Calver
8e0e797b40
Fix code style 2022-09-15 13:29:27 +12:00
Loz Calver
749405170c
Update MySQLDatabaseTest to work with new query iterators 2022-09-15 13:29:10 +12:00
Sam Minnee
77c7552c3f
NEW: ORM’ Query is a generator-based IteratorAggregate
API: Query no longer has iterator methods current(), first(), rewind(), next()

Using generators reduces the amount of boilerplate needed for this
code.

Turning it into an IteratorAggregate means that the iterator can be
re-created for each subsequent foreach call. This means that the
rewind() and seek() functionality can be discarded.
2022-09-15 13:28:56 +12:00
Sam Minnee
d8735633a7
FIX: Don’t call PaginatedList::getIterator() directly.
It’s best for foreach() to call this for us.
2022-09-15 13:28:20 +12:00
Guy Sartorelli
03b929dd33
API Remove support for PDO (#10499) 2022-09-15 13:13:48 +12:00
Guy Sartorelli
06b13e0fa6
Revert "Merge pull request #10450 from creative-commoners/pulls/5/rescue-master-generators" (#10483)
This reverts commit 9edf3a5ca6, reversing
changes made to 934fafd29d.
2022-09-02 10:58:37 +12:00
Guy Sartorelli
1bf86cf39f
API Revert shorten auto-generated table names (#10482)
* Revert "BUG Fix table name test"

This reverts commit b36a01a8fd.

* Revert "ENH shorten auto-generated table names"

This reverts commit 156f63bce3.
2022-09-02 10:55:45 +12:00
Steve Boyd
37ff4ee46a
Merge pull request #10454 from creative-commoners/pulls/5/rescue-master-table-name
API rescue master-branch PR: Shorten auto-generated table names #7621
2022-09-01 09:12:11 +12:00
Steve Boyd
9edf3a5ca6
Merge pull request #10450 from creative-commoners/pulls/5/rescue-master-generators
API rescue master-branch PR: Use Generators for ORM
2022-08-29 19:03:47 +12:00
Steve Boyd
b37921d0b1
Merge pull request #10462 from creative-commoners/pulls/5/rescue-master-join-aliases
Rescue Master Branch PR: Fix SQLConditionalExpression::getJoins so it always adds explicit aliases
2022-08-24 15:33:41 +12:00
Serge Latyntcev
e07671a890
Fix SQLConditionalExpression::getJoins so it always adds explicit aliases
This is a revert of https://github.com/silverstripe/silverstripe-framework/pull/8956
2022-08-24 11:27:02 +12:00
Andrew Aitken-Fincham
f2de39162d
API Allow dataobject get_one without passing a class
add class validation early in get_one()
2022-08-23 16:25:23 +12:00
Christopher Joe
b36a01a8fd
BUG Fix table name test 2022-08-22 17:47:14 +12:00
Guy Sartorelli
4cb36d4d14
MNT Fix test 2022-08-11 16:29:39 +12:00
Daniel Hensby
595835bb15
Merge pull request #6518 from sminnee/generators
Use Generators for ORM Query, Map, ArrayList
2022-08-11 16:29:32 +12:00
Guy Sartorelli
11595952f4
NEW Search across multiple searchable fields by default (#10382)
* NEW Search across multiple searchable fields by default

* ENH Split search query and search each term separately.
2022-08-01 12:19:02 +12:00
Loz Calver
d79564751f
Merge pull request #10406 from creative-commoners/pulls/4/manymany-extra-fields
NEW Set many_many_extraFields data via the ORM
2022-07-28 09:02:13 +01:00
Steve Boyd
bd2ba1e18a Merge branch '4.11' into 4 2022-07-28 14:05:28 +12:00
Steve Boyd
b24c289892 Merge branch '4.10' into 4.11 2022-07-28 14:05:07 +12:00
Steve Boyd
bdf7d09144 MNT Update Utf8TestHelper for MySQL 8.0.30 2022-07-28 13:21:23 +12:00
Guy Sartorelli
af3c50c9da NEW Set many_many_extraFields data via the ORM 2022-07-28 09:29:36 +12:00