Commit Graph

449 Commits

Author SHA1 Message Date
Michal Kleiner 21129b1624
Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00
Mojmir Fendek 7dc6b36c16
Unique key for DataObject (#9400)
NEW Unique key for DataObject
2020-05-04 09:10:51 +12:00
Robbie Averill 8bd9f48669
Merge pull request #9501 from mattclegg/1588075087
DOCS: Fix typos & grammer
2020-04-28 09:42:03 -07:00
mattclegg df8cb9e010
DOCS: Update `filter` to use correct class 2020-04-28 17:50:40 +05:45
mattclegg 76bc7524a7
DOCS: Fix typos & grammer 2020-04-28 17:50:39 +05:45
Dan Hensby 28ba4f701a
Merge branch '4.5' into 4 2020-04-27 09:54:27 +01:00
Dan Hensby 13b4d60d4a
Merge branch '4.4' into 4.5 2020-04-27 09:53:42 +01:00
Dan Hensby 85b37999be
Merge branch '4.3' into 4.4 2020-04-27 09:52:52 +01:00
Dan Hensby e328d6f0d9
Merge branch '4.2' into 4.3 2020-04-27 09:51:24 +01:00
Dan Hensby b9f8ab44ac
Rename DBBigint.php for composer autoloading compatability 2020-04-24 23:15:42 +01:00
Daniel Hensby 237b2d5f74
Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
Serge Latyntcev cb36aab80c Merge branch '4.5' into 4 2020-04-15 14:49:19 +12:00
Daniel Hensby 03239f9dcc
Merge pull request #9454 from open-sausages/pulls/4/myisam
NEW Allow InnoDB for FULLTEXT indexes
2020-04-14 11:50:45 +01:00
mattclegg 60e670176a
DOCS: Correct spelling 2020-04-14 15:00:08 +05:45
Ingo Schommer a50e15e5ee FIX Avoid VACUUM on test dbs in Postgres
The Postgres implementation was always faulty,
but the database exception was swallowed until
See https://github.com/silverstripe/silverstripe-framework/pull/9456.

Now that the the exception is only swallowed the first time,
the second recurrence will cause failing test execution.

This is a bit of an awkward fix, but the indirection "through" DataObject doesn't allow for anything else without changing public API surface.
The logic goes from TempDatabase to DBSchemaManager, then through the closure into DataObject->requireTable(),
then back into DBSchemaManager->requireTable(). And updateschema() is subclassed in SQLite3, making it difficult to add more arguments.

VACUUM is described as:

> VACUUM reclaims storage occupied by dead tuples. In normal PostgreSQL operation, tuples that are deleted or obsoleted by an update are not physically removed from their table; they remain present until a VACUUM is done. Therefore it's necessary to do VACUUM periodically, especially on frequently-updated tables.

https://www.postgresql.org/docs/9.1/sql-vacuum.html

Since test databases are short-lived, there's no reason to delete dead tuples, they'll be garbage collected when either the transaction is rolled back, or the database is destroyed after the test run.
2020-04-09 14:43:16 +12:00
Ingo Schommer 2c5deceeb4 FIX Filter out all FULLTEXT BOOLEAN chars
The query might still work depending on where these chars are placed,
but it seems weird to only remove *some* of the valid chars here.
See https://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html

Note that the query runs both the actual boolean query with chars,
and then a separate relevance search without them.
2020-04-09 10:32:45 +12:00
Ingo Schommer 0215fdd262 DOC Clarify sanitisation in searchEngine() under boolean mode
This came up in https://github.com/silverstripe/silverstripe-cms/issues/1452, and wasn't fully addressed.
Either we allow boolean mode and all the constraints this brings around special character usage,
or we filter out those special characters, which makes boolean mode pointless.
You can't just pass arbitrary user input in a power-user function like this.
See https://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html

Context: This used to work for some examples like "foo>*" under MyISAM,
presumably because it had a more lenient parser. InnoDB rightfully complains about this now.
2020-04-09 10:32:45 +12:00
Ingo Schommer c6b698cb02 NEW Allow InnoDB for FULLTEXT indexes
MyISAM used to be the only one to support it, now InnoDB has caught up.
Unless an engine is set specifically in create_table_options,
this will auto-convert existing MyISAM tables to InnoDb.

Fixes #9242
2020-04-09 10:32:45 +12:00
Ingo Schommer 052c5cbc38 BUG Infinite loops in TempDatabase (fixes #8902)
Ugly, but so is the original implementation that this works around (swallowing an exception to trigger functionality)
2020-04-08 13:58:02 +12:00
Steve Boyd 8c7e10bd55 Merge branch '4.5' into 4 2020-02-11 16:45:35 +13:00
Steve Boyd 9d5c3ef20e Merge branch '4.4' into 4.5 2020-02-11 16:45:15 +13:00
Mojmir Fendek 285e6caafa PR fixes 2020-02-11 10:43:01 +13:00
Mojmir Fendek 448147c2f1 PR fixes 2020-02-10 09:17:34 +13:00
Mojmir Fendek 660f80d284 PR fixes 2020-02-07 13:49:19 +13:00
mnuguid ca36a47bb1 FIX Update ORM DBField types to use Injector in scaffoldFormField()
- This is usable in cases where a DBField is needed to be overloaded through the Injector.
2020-02-04 21:43:47 +13:00
Mojmir Fendek 99786dda22 ORM Column now supports related table lookup 2020-01-28 15:46:30 +13:00
Robbie Averill 4121099484 Merge branch '4.5' into 4 2020-01-16 20:00:02 -08:00
Robbie Averill 53fcd47dfc Merge branch '4.4' into 4.5 2020-01-16 19:59:42 -08:00
Martin D ec6a353543 array_key_exists() on objects is deprecated
Ref: https://wiki.php.net/rfc/deprecations_php_7_4#array_key_exists_with_objects
2020-01-14 09:22:49 -08:00
Garion Herman af90d17e19
Merge pull request #9359 from open-sausages/pulls/4.4/dbhtmlvarchar-scafolding
BUG Remove bad default when scaffolding form field for DBHTMLVarchar
2020-01-07 09:33:25 +13:00
Maxime Rainville 31a8c16c43
Remove default row size 2020-01-07 09:13:03 +13:00
Maxime Rainville 8d69cf9f75 BUG Remove bad default when scaffolding form field for DBHTMLVarchar 2019-12-18 17:32:02 +13:00
Andre Kiste 6650d81324 BUG Fix extra blank Group being created when creating a new Group (#9325)
* Fix extra blank Group being created when creating a new Group

* Update tests to reflect expected behavior

* Improved tests
2019-11-27 09:32:33 +13:00
Serge Latyntcev 33a28394d6 Merge branch '4.4' into 4 2019-10-18 15:59:28 +13:00
Serge Latyntcev 0cf5d4cbe2 Merge branch '4.3' into 4.4 2019-10-18 15:58:13 +13:00
Serge Latyntcev 46b9530d88 PSR2 linting fixes 2019-10-18 15:31:39 +13:00
Michal Kleiner bcbf90a837 NEW Introduce supported database transaction mode check 2019-09-16 14:44:15 +12:00
Robbie Averill aa6b244db9 Merge branch '4.4' into 4 2019-09-13 18:11:46 -07:00
Robbie Averill 592ab6abc1 Merge branch '4.3' into 4.4 2019-09-13 18:11:34 -07:00
Maxime Rainville 591b88a9bc BUG Allow infinite loop when calling DataObject::writeComponent() recursively 2019-09-10 14:15:28 +12:00
Robbie Averill 45f86658ca Merge branch '4.4' into 4 2019-08-14 09:31:05 +12:00
Robbie Averill 4b44272367 Merge branch '4.3' into 4.4 2019-08-14 09:30:53 +12:00
Robbie Averill d63e4b520c Merge branch '4.2' into 4.3 2019-08-14 09:30:41 +12:00
Will Rossiter 82cc8b40a4 Create SearchContext via Injector (#9156) 2019-08-01 14:39:58 +12:00
UndefinedOffset 40cd66852e BUGFIX: Fixed issue where multiple relationship sort order columns would be lost in favor of only the last relationship column in the sort order 2019-07-26 11:54:10 -03:00
Simon Gow 22b514c421 #9114 - DBText::ContextSummary() cuts line breaks
ContextSummary() was cutting the HTML which was added by nl2br because
it expected plain text elements as it's stripping and replacing text.
Instead this fix changes the behaviour to apply the nl2br after the text
changes have been made. That way we can't cut anything in the middle of
a HTML tag, but new lines, or paragraphs are replaced by BRs after,
should they exist.

- Added tests to ensure text is not cut in the middle of a sentence.
- Added test to ensure that <br>'s are added in the correct place should
the summary span between new lines.
2019-07-19 12:43:20 +12:00
Serge Latyntcev 29a663c65d Merge branch '4.4' into 4 2019-07-15 09:24:49 +12:00
Serge Latyntcev d667d64f13 Merge branch '4.3' into 4.4 2019-07-15 09:18:17 +12:00
Guy Marriott ec66d366d2
NEW: Deprecated PDO in favour of native drivers (#9052)
NEW: Deprecated PDO in favour of native drivers
2019-07-08 12:41:13 +12:00
Robbie Averill 844d2ef134 NEW DBDate and DBDatetime now support modify() with a strtotime() style adjustment string (#9105) 2019-07-05 15:57:23 +12:00