Commit Graph

2376 Commits

Author SHA1 Message Date
Guy Sartorelli dec85819bd Merge branch '4.10' into 4.11 2022-05-27 15:19:39 +12:00
Guy Sartorelli 0bc3ed4d2c Merge branch '4.9' into 4.10 2022-05-27 15:19:17 +12:00
Guy Sartorelli 2cf1725ba6
Merge pull request #10317 from silverstripe-terraformers/feature/mock-sleep
NEW: Mock sleep unit test utility.
2022-05-27 13:52:01 +12:00
Guy Sartorelli 9d73b7b4bd Merge branch '4.11' into 4 2022-05-27 12:55:53 +12:00
Guy Sartorelli 972a77f4d3 Merge branch '4.10' into 4.11 2022-05-27 12:55:35 +12:00
Guy Sartorelli e0c4f01c11 FIX Resolve deduping problem with group codes.
Also remove dead validation code.
2022-05-27 11:19:32 +12:00
Guy Sartorelli 07aae0e56a
Merge pull request #10330 from creative-commoners/pulls/4.9/permissions-repeated-records
ENH Replace record in Permission Table if GroupID already exist
2022-05-23 18:30:21 +12:00
Sabina Talipova 70f1dc8841 ENH Override record if a provided GroupId with provided Code already exist in Permission table. 2022-05-23 14:52:33 +12:00
Guy Sartorelli a8652f7cbb ENH Restore gridfield state from get vars 2022-05-23 10:57:13 +12:00
Steve Boyd db5fbcd035 Merge branch '4.11' into 4 2022-05-19 17:25:42 +12:00
Steve Boyd d3252b1645 Merge branch '4.10' into 4.11 2022-05-19 17:25:15 +12:00
Mojmir Fendek a9a6b0f114 PR fixes. 2022-05-19 14:09:04 +12:00
Steve Boyd 6c5448b70f Merge branch '4.11' into 4 2022-05-18 13:43:06 +12:00
Steve Boyd dfa0571d6d
Merge branch '4' into patch-1 2022-05-18 11:29:18 +12:00
Loz Calver 903dd860b7 ENH: Add extension hooks to core emails 2022-05-16 10:02:49 +01:00
Sabina Talipova cb37869bac
Merge pull request #10297 from creative-commoners/pulls/4/gridfield-set-polymorphic-class
Issue was fixed
2022-05-13 14:01:17 +12:00
Guy Sartorelli c0ff638cd8
Merge pull request #10307 from silverstripe-terraformers/feature/removal-all-enhancement
ENH: RemoveAll() memory performance enhancement.
2022-05-13 14:00:29 +12:00
Steve Piner e91b7be056 FIX Use DataColumns content when available in CSV export
Fix #9248 broke #9173 by accidentally checking for a string key in a
numerically indexed array. Change the check to search the array instead
(fixes #10308)
2022-05-13 13:53:04 +12:00
Mojmir Fendek 78d20f6fe5 NEW: Mock sleep unit test utility. 2022-05-13 13:15:24 +12:00
Mojmir Fendek 26d59944e0 ENH: RemoveAll() memory performance enhancement. 2022-05-13 11:19:04 +12:00
Steve Boyd 13e79ef8fc Merge branch '4.11' into 4 2022-05-13 09:51:29 +12:00
Steve Boyd 89582dd476
Merge pull request #10313 from creative-commoners/pulls/4.11/email-when-password-changes
ENH Ensure users are sent emails when passwords are changed by default
2022-05-13 09:39:14 +12:00
Steve Boyd 6a779d07d0 ENH Allow multiple backtick variables in a single value 2022-05-12 17:12:14 +12:00
Guy Sartorelli 63f3637dc2 ENH Ensure users are sent emails when passwords are changed by default. 2022-05-12 11:42:27 +12:00
Guy Sartorelli 5436df57e4 FIX Add polymorphic class on new records for use in forms. 2022-05-11 14:04:52 +12:00
Guy Sartorelli b64ad664bb Merge branch '4.11' into 4 2022-05-11 12:07:46 +12:00
Guy Sartorelli 35d5f16286
Merge pull request #10274 from tiller1010/check-for-dot-syntax-component
Check for component before saving, fallback to full form field name
2022-05-09 15:15:50 +12:00
Guy Sartorelli 19bb72e7c7 FIX Correctly remove relations with ManyManyThroughList::removeall
Instead of just setting one side of the relation to null in the through
list, remove the rows entirely.
Remove only the relations which match the filters that have already been
set on the list.
This is consistent with the way ManyManyList works.

Also some small tidy-up (removing an unnecessary line break and an
unused "use" statement)
2022-05-05 11:21:51 +12:00
Ed Wilde 0b6b2d1524
Fix error when `posix_getpwuid` returns false
The posix_getpwuid function can return false if it fails (see [docs](https://www.php.net/manual/en/function.posix-getpwuid.php#:~:text=The%20function%20returns%20false%20on%20failure.)).
2022-05-04 09:05:19 +12:00
Guy Sartorelli 2836478c72 API Add method to get foreign class key on polymorphic has_many 2022-05-02 18:29:01 +12:00
Steve Boyd 337c6e583c ENH Various fixes for PHP 8.1 compatibility 2022-04-27 09:29:40 +12:00
Guy Sartorelli 2411a83d5d
Merge pull request #10291 from creative-commoners/pulls/4/revert
FIX Revert adding extension hook
2022-04-26 12:00:26 +12:00
Steve Boyd 345173343c FIX Revert adding extension hook 2022-04-26 09:58:45 +12:00
Steve Boyd 511b3bb060 ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +12:00
Steve Boyd f1678781a2 ENH Various fixes for PHP 8.1 compatibility 2022-04-11 17:22:22 +12:00
Maxime Rainville 3e5a74c6b2
Merge pull request #10273 from creative-commoners/pulls/4/remove-ini-setting
ENH Fix deprecation issues for PHP 8.1 compatibility
2022-04-07 13:25:24 +12:00
Steve Boyd 814c5b2fd0 ENH Fix deprecation issues for PHP 8.1 compatibility 2022-04-06 11:34:34 +12:00
Steve Boyd 3202ef7c52 Merge branch '4.10' into 4 2022-04-06 10:42:58 +12:00
Tyler 13b81c5e38 Check for component before saving, fallback to full form field name 2022-04-05 14:39:23 -04:00
Maxime Rainville cb05e52b0f
Merge pull request #10244 from creative-commoners/pulls/4/embed
NEW Use embed/embed v4
2022-03-25 15:38:17 +13:00
Steve Boyd 9add508718 NEW Use embed/embed v4 2022-03-24 10:27:15 +13:00
Maxime Rainville 77e87875b3
Merge pull request #10211 from creative-commoners/pulls/4.10/seach-filter-tests
FIX Default GridField search fields with an index of 0 to use StartWithFilter
2022-03-23 11:37:15 +13:00
Steve Boyd 78c9aea61f
ENH Faster method for creating injected instances (#10265) 2022-03-23 10:39:58 +13:00
Steve Boyd 740d087e97 FIX Default GridField search fields with an index of 0 to use StartWithFilter 2022-03-22 16:17:37 +13:00
Tobias Bossert be65db7207
removed impossible method name contraint 2022-03-20 18:42:39 +01:00
Nicolaas / Sunn Side Up 334bd48d27
PATCH: add `MemberAuthenticator::checkPassword()` to backtrace::$ignore_function_args 2022-03-17 22:48:08 +00:00
Steve Boyd 081ec34461 Merge branch '4.10' into 4 2022-03-10 11:30:03 +13:00
Steve Boyd 82aba312fe Merge branch '4.9' into 4.10 2022-03-10 11:27:48 +13:00
Steve Boyd 204b39bfdf FIX Handle admin_email array config 2022-03-10 10:37:47 +13:00
Maxime Rainville 78dcfd217a
Merge pull request #10235 from creative-commoners/pulls/4/meta-generator
NEW Get the version for an individual module
2022-03-09 13:41:12 +13:00
Steve Boyd b73a3cdd7a API Extension hook for email default from 2022-03-08 14:31:51 +13:00
Steve Boyd f488f38f7d NEW Get the version for an individual module 2022-03-08 13:48:43 +13:00
Steve Boyd 09fdfc4611 Merge branch '4.10' into 4 2022-03-08 12:21:52 +13:00
Steve Boyd 59800b5879 Merge branch '4.9' into 4.10 2022-03-08 12:21:03 +13:00
Steve Boyd badc17891c ENH Create fallback email from address 2022-03-07 16:18:57 +13:00
Michal Kleiner 342611d202
Merge pull request #10232 from creative-commoners/pulls/4/serializable
API Implement updated Serializable API
2022-02-14 18:26:04 +13:00
Steve Boyd 0318372641 API Implement updated Serializable API 2022-02-14 13:26:11 +13:00
Michal Kleiner ba80f4baa9
Merge pull request #9996 from signify-nz/enh/gridfield-readonly-transformation
ENH Provide ways to modify read-only gridfields globally.
2022-02-12 22:10:29 +13:00
Tyler Trout 6b1c5eb6d7
NEW Allow methods to be used for flexible searchable_fields (#10199)
* Allow methods to be used for flexible searchable_fields

* match_any key

* Documentation

* Update docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md

Co-authored-by: GuySartorelli <36352093+GuySartorelli@users.noreply.github.com>

* Search fields test

* Newlines

* Update src/ORM/Search/SearchContext.php

Co-authored-by: Steve Boyd <emteknetnz@gmail.com>

* Update docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md

Co-authored-by: Steve Boyd <emteknetnz@gmail.com>

* Removed comments and whitespace. Linting fixes

Co-authored-by: GuySartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2022-02-10 09:40:16 +13:00
Michal Kleiner 756e67d746
Merge pull request #10226 from GuySartorelli/patch-2
DOC Update old pre-namespaces PHPDoc
2022-02-08 15:02:56 +13:00
Michal Kleiner 578f3e035f
Merge pull request #10224 from webbuilders-group/bugfix-undefined-class
FIX Fix issue where an undefined class error would be thrown when getting objects or ids from fixtures
2022-02-08 13:49:28 +13:00
GuySartorelli 95be6ed077
DOC Update old pre-namespaces PHPDoc
The code in the original PHPDoc would have produced an error if used.
2022-02-08 13:03:45 +13:00
UndefinedOffset 34118efbc6
BUGFIX: Fixed issue where an undefined class error would be thrown when getting objects or ids from fixtures 2022-02-07 09:45:18 -04:00
Mojmir Fendek 89c87ddbf8
NEW: Static validation for relationships. (#9874)
* NEW: Static validation for relationships.

* Unit tests added.

* PR fixes

* PR feedback: Execute validation on flush.

* PR fixes.

* PR fixes.
2022-02-04 14:41:09 +13:00
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
GuySartorelli 5c54276b6f
ENH Make all GridField components injectable (using abstract class) (#10204)
* ENH Make all GridField components injectable.

Some components were already injectable, but all GridField components shipped in silverstripe should be injectable.
This makes it a LOT easier to make global project-specific changes to a given component.
The new AbstractGridFieldComponent also makes it easy to make similar wide-spread changes in the future.

* DOCS Encourage injection for GridField and GridFieldComponents.
2022-02-02 11:14:33 +13:00
GuySartorelli fc2160fa3a
ENH Provide hook for updating the parent used for absoluteURL (#10168)
One use case for this that I've run into a few times is for sending emails using a queued job from the CLI.
2022-01-31 20:41:14 +13:00
Steve Boyd 6691d31121 Merge branch '4.10' into 4 2022-01-25 16:09:14 +13:00
Thomas Portelange 0cfd98d87a
FIX support search filter instances (#9991)
and also fully qualified class names
2022-01-21 16:33:51 +13:00
Steve Boyd 511b8a4c71 Merge branch '4.10' into 4 2022-01-19 16:03:42 +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
Steve Boyd 94f976d985
Merge pull request #9894 from brettt89/fix/single-select-empty-default
Move hasEmptySchema and emptyString to DataSchema on SingleSelectField
2022-01-18 11:11:17 +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
Christian Bünte c6ee8c0b34
Obtain module path from module manifest (#9720) 2022-01-17 11:44:14 +13:00
Nicolaas / Sunn Side Up e40a95af27
MINOR: add filterable and sortable field indexes (#10189) 2022-01-17 10:55:55 +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 7b19299fbe
Merge pull request #10190 from sunnysideup/patch-21
ENH Add index to PermissionRoleCode.Code for filtering + sorting
2022-01-15 10:28:38 +13:00
Michal Kleiner 3963dd4ecc
Merge pull request #10183 from kinglozzer/readonly-extraclass
FIX Ensure extra classes are copied over to readonly/disabled fields
2022-01-15 10:27:39 +13:00
Steve Boyd cbf2987a61
FIX Disallow negative values for FailedLoginCount (#10200) 2022-01-14 11:29:49 +13:00
Mojmir Fendek 048eb4b614 ENH Improve gridfield export pefromance by using DataList generator 2022-01-12 07:01:00 +13:00
Michal Kleiner acb04e3d17
Merge pull request #10172 from ssmarco/patch-1
TestMailer - Add Headers attribute in order for tests to assert its contents
2022-01-10 09:54:13 +13:00
Marco Hermo bf183c8090 TestMailer - Add Headers attribute in order for tests to asserts its
contents

Update TestMailer.php

Good point, adding all headers as suggested.
2022-01-10 09:45:51 +13:00
Nicolaas / Sunn Side Up 41530f0be3
MINOR: adding index to PermissionRoleCode.Code for faster filtering and sorting 2022-01-05 09:40:12 +13:00
Loz Calver cb37e5fb87 FIX: Ensure extra classes are copied over to readonly/disabled fields 2021-12-17 09:16:43 +00:00
Steve Boyd ed492da636 Merge branch '4.10' into 4 2021-12-16 17:45:33 +13:00
Steve Boyd 8b3bec9c68 Merge branch '4.9' into 4.10 2021-12-16 10:58:13 +13:00
Steve Boyd d5f0c78262 Merge branch '4.8' into 4.9 2021-12-16 10:57:58 +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
Steve Boyd e11820d44f FIX Look for existing modules in vendor folder rather than base folder 2021-12-13 17:27:23 +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
Maxime Rainville 9ea608d0f2
Merge pull request #10021 from xini/fix-login-marker-cookie
remove login marker cookie on logout
2021-12-13 10:48:32 +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
Steve Boyd a3d9648687 FIX Ensure tmpItem has a value before calling method_exists on it 2021-11-25 15:52:51 +13:00
Maxime Rainville e0197191b8 Rename "Ignore CI Configs" to "Ignored CI Config" 2021-11-22 11:02:27 +13:00
Maxime Rainville 7c3fddfc8a Anwser Peer review feedback 2021-11-18 23:16:03 +13:00
Maxime Rainville cbc4593ab4 ENH Don't index test from PHPUNit 5.7 module wdon using PHPUnit 9.5 2021-11-18 21:45:53 +13:00
Maxime Rainville 640a7e3eea ENH Improve ManifestFileFinder so it can ignore test based on the testing library 2021-11-18 21:45:53 +13:00
Maxime Rainville 2922370d81 API Add Module::getCILibrary function 2021-11-18 21:45:53 +13:00
Maxime Rainville 1bc1e85f68 DOC Fix minor typos in Module 2021-11-18 21:44:26 +13:00
Steve Boyd d2cbf5bc2a Merge branch '4.9' into 4 2021-11-18 17:24:41 +13:00
Maxime Rainville b43d68f9b4 API Add an AttributesHTML trait 2021-11-18 15:31:01 +13:00
Loz Calver 29fa365d10
Fix support for setting TEMP_PATH in .env (fixes #8099) (#10138) 2021-11-16 09:35:28 +13:00
Sergey Shevchenko 5e26757a9e
Merge branch 'silverstripe:4' into 4 2021-11-15 22:07:11 +13:00
LiamKearn a08f43b762
DOC Fix misleading code docblocks (#10145) 2021-11-09 14:55:06 +13:00
Loz Calver b1eb9514d4
FIX Prioritise posix_getuid() when attempting to find current process owner (#10137) 2021-11-08 11:56:44 +13:00
Loz Calver 20134e6a4f
NEW Add FirstPage() and LastPage() to PaginatedList (#10129) 2021-11-08 09:26:21 +13:00
Loz Calver d6866af7e5 Fix broken tests 2021-11-04 10:53:42 +00:00
Kirk Mayo b8d37f9ae4
NEW Validate the Title on Group is not empty (#10113) 2021-11-03 14:26:16 +13:00
GuySartorelli fc349db511
API Add a way to check if a form or form field has an extra css class (#10112)
Required for silverstripe/silverstripe-admin#1252
2021-11-01 17:01:17 +13:00
Sergey Shevchenko 04b7ad51b8
Merge branch 'silverstripe:4' into 4 2021-11-01 13:12:59 +13:00
Florian Thoma 31668e8acf fix: remove login marker cookie on logout
Apply suggestions from code review

Co-authored-by: Michal Kleiner <mk@011.nz>
2021-11-01 10:04:18 +11:00
Steve Boyd cd076542f4
API Upgrade SapphireTest to work with phpunit 9 (#10028) 2021-10-27 15:39:47 +13:00
GuySartorelli 059d8aac0a
NEW Add afterUpdateCMSFields method to DataObject. (#9819) 2021-10-26 16:05:11 +13:00
GuySartorelli 49a7f08c07
ENH: Display validation messages for GridFields (#10015)
* FIX: Display validation messages for GridFields
* ENH: Add test for GridField validation messages.
2021-10-19 12:03:40 +13:00
Steve Boyd 3a852bed36 Merge branch '4.9' into 4 2021-10-19 11:14:19 +13:00
Steve Boyd 766a024a03 Merge branch '4.8' into 4.9 2021-10-19 11:13:50 +13:00
Steve Boyd 04f9a80c0e Merge branch '4.7' into 4.8 2021-10-19 11:13:31 +13:00
Steve Boyd 0361f10f4c
Merge pull request #9869 from chrispenny/bugfix/composite-validator-calls-php
CompositeValidator::validate() to call validate() instead of php(). Fixes #9868
2021-10-19 11:10:43 +13:00
Thomas Portelange 6e2955fe14
BUG Allow extension of getAttributes for Tab and TabSet (#9954) 2021-10-18 23:22:01 +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
Maxime Rainville 1c698348a2 BUG When asserting an email was sent, sanitise both the To and From field 2021-09-09 19:23:37 +12:00
Steve Boyd 0a389112ca FIX Only send email if email address set 2021-09-07 11:20:29 +12:00
Steve Boyd 00e29758ff DOC Add information regarding Security::setCurrentUser() 2021-09-06 14:04:53 +12:00
Steve Boyd b5c3b60502
Merge pull request #10047 from madmatt/pulls/extend-hydrate
NEW Add extension point to DataObject->hydrate()
2021-08-27 10:41:06 +12:00
Maxime Rainville 02c9736e23 Merge branch '4.8' into 4 2021-08-26 16:58:09 +12:00
Matt Peel f99ba5d716 NEW Add extension point to DataObject->hydrate() 2021-08-25 16:07:02 +12:00
Steve Boyd de87d91d22 FIX Trim email addresses to comply with RFC 2822, 3.6.2 2021-08-24 10:06:15 +12:00
Steve Boyd 92f47da08b
API Update SwiftMailer from v5 to v6 (#10048)
* Update SwiftMailer from v5 to v6

- Fixes #9834
- Update default Swift_Transport to use Swift_SendmailTransport
- Update version restraint for Swiftmailer
- Address new parameter type for Swift_Message::setDate()
- Update class references in docblocks

Co-authored-by: Danaë Miller-Clendon <danae.millerclendon@silverstripe.com>
2021-08-18 12:16:45 +12:00
Steve Boyd 0ea36ad5d6
Merge pull request #10027 from chrometoasters/pulls/director-extension-point-4.8
NEW Add extension point to Director::is_site_url
2021-08-07 09:56:31 +12:00
Daniel Hensby 83b458ff59
Merge pull request #10022 from xini/fix-session-destroy
take current request protocol into account when deleting session cookie
2021-08-06 10:06:08 +01:00
Florian Thoma 9a7c99fc4b FIX Take current request protocol into account when deleting session cookie 2021-08-06 10:55:05 +10:00
Michal Kleiner f8a9431152 NEW Add extension point to Director::is_site_url 2021-08-06 12:54:18 +12:00
Steve Boyd e0548b208e
Merge pull request #10044 from TheBnl/patch-1
Fix error when executing method SSViewer::templates() when $subTempla…
2021-08-06 09:49:00 +12:00
Steve Boyd 9b42624616
Merge pull request #9994 from GuySartorelli/patch-1
ENH Provide onBeforeRenderHolder extension hook in GridField.
2021-08-06 09:47:53 +12:00
Bram de Leeuw ecb233012d
Fix error when executing method SSViewer::templates() when $subTemplates is still null
Without the fix this causes the framework to throw a 500 error:
`ERROR [Warning]: array_merge(): Expected parameter 2 to be an array, null given`

I noticed the error while doing a search with the `GridFieldAddExistingAutocompleter`. The error probably gets supressed on live environments.
2021-08-05 12:10:06 +02:00
Steve Boyd d120367b5a
Merge pull request #9999 from GuySartorelli/patch-2
ENH Use text field's title for validation messages.
2021-08-05 15:47:03 +12:00
Steve Boyd 6b514ebd0c
Merge pull request #10040 from GuySartorelli/patch-5
ENH: Avoid "new" keyword to instantiate CompositeValidator
2021-08-05 13:39:43 +12:00
Steve Boyd dc3b907f5f
Merge pull request #10029 from creative-commoners/pulls/4/titletip
NEW Title tips for form fields
2021-08-03 14:04:55 +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
Steve Boyd a90d46dbc4 NEW Title tips for form fields 2021-07-31 14:45:24 +12:00
Daniel Hensby 507c70e2f5
Merge pull request #10023 from xini/fix-destroy-session-on-logout 2021-07-20 09:13:20 +01:00
Florian Thoma 3e2ca3027b destroy session on logout instead of restarting it 2021-07-20 12:05:16 +10:00
GuySartorelli 4cd6b1434a
ENH Reduce duplication of code in GridField view and edit buttons. (#9953)
* ENH Reduce duplication of code in GridField view and edit buttons.

* Fix syntax error

Co-authored-by: Daniel Hensby <dhensby@users.noreply.github.com>

Co-authored-by: Daniel Hensby <dhensby@users.noreply.github.com>
2021-07-18 16:54:22 +01:00
Nicolaas c8c7ee4a08
DOCS better docblock for TinyMCEConfig::removeButtons 2021-07-18 11:30:29 +01: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
Ingo Schommer b2a85e7a02
FIX BASE_PATH fallback assumed wrong file location (#9977)
The file was moved back in 2017 with 3873e4ba00 (diff-8ce3f007bef0668c2c08320160362229abce9614025dc2a5b729d1b2b56ed3f7),
but the logic wasn't updated. That wasn't apparent since the fallback usually doesn't need to be triggered.
Whenever constants.php is included through the standard composer autoload, the debug_backtrace() logic took priority.

This is an important piece for using CoreKernel directly to boot Silverstripe,
which I'm currently attempting through a composer plugin (so a different autoloading path).
https://github.com/silverstripe/silverstripe-graphql-composer-plugin
2021-07-08 11:11:39 +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
Ingo Schommer e8c14a9d5b
Merge pull request #10005 from creative-commoners/pulls/4.8/10k
FIX Parse Enums with dots in their values
2021-07-02 09:33:29 +12:00
Steve Boyd 8e803bbcfc FIX Parse Enums with dots in their values 2021-07-01 16:00:08 +12:00
GuySartorelli e4e4b0924d
ENH Use text field's title for validation messages.
Where a field has a title, this is preferred over the field name in validation messages, as that is the "name" of the field as presented to the user.
2021-06-29 17:45:01 +12:00
Steve Boyd 0b979dc345 FIX Cache duplicate embeds separately 2021-06-29 12:17:07 +12:00
Guy Sartorelli 365998f445 ENH Add extension point for modifying readonly GridFields.
Developers may want to amend a gridfield (either by modifying its
components or amending the list) after it has been transformed to be
readonly.
One such modification may be replacing the GridFieldViewButton
with something else - because components are instantiated with the "new"
keyword this would be the only way to do that.
2021-06-29 11:23:58 +12:00
Guy Sartorelli 009a32fbec ENH Allow GridField readonly components to be globally modified. 2021-06-29 11:21:41 +12:00
GuySartorelli d710990e13
ENH Provide onBeforeRenderHolder extension hook.
GridField has onBeforeRender in its Field method, but that hardly ever gets called.
This commit adds the onBeforeRenderHolder extension hook that is normally available via FormField::FieldHolder().
2021-06-25 13:21:49 +12:00
Steve Boyd 325021c2f8 Merge branch '4.8' into 4 2021-06-21 14:59:01 +12:00
Steve Boyd e812999632 Merge branch '4.7' into 4.8 2021-06-21 14:58:40 +12:00
Steve Boyd b625ba99b3 ENH Remove wording for authenticated devices being manageable 2021-06-18 09:50:13 +12:00
Steve Boyd 7ed7ad0254 FIX Ensure changing a password to blank is validated 2021-06-17 12:05:20 +12:00
Loz Calver 5bb5ef80ed FIX: Form::defaultAction() didn't work if actions were in CompositeFields (fixes #9975) 2021-06-09 17:26:43 +01:00
Steve Boyd 06dbd5237b [CVE-2020-26138] Validate custom multi-file uploads 2021-06-09 09:34:37 +12:00
Steve Boyd 3bb435c241 [CVE-2020-25817] Prevent loading of xml entities 2021-06-09 09:34:26 +12:00
Steve Boyd 9463aaf571 Merge branch '4.8' into 4 2021-06-08 11:49:01 +12:00
Steve Boyd fb0d769049
Merge pull request #9969 from creative-commoners/480-tag
Security fixes from 4.8.0
2021-06-08 11:47:35 +12:00
David Peck 28b5b803be FIX Defensively copy mocked datetime 2021-06-05 16:46:19 +12:00
Steve Boyd 8024551376 [CVE-2020-26138] Validate custom multi-file uploads 2021-06-02 16:24:23 +12:00
Steve Boyd 7f97734a20 [CVE-2020-25817] Prevent loading of xml entities 2021-06-02 16:24:17 +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
Ingo Schommer 196752566f
Merge pull request #9655 from sminnee/pulls/9647-find-lost-records
NEW: Add GridFieldDetailForm::setRedirectMissingRecords()
2021-05-21 13:53:18 +12:00
Sam Minnee 8883413ba7 NEW: Add GridFieldDetailForm::setRedirectMissingRecords()
This new opt-in setting will let grid field detail forms redirect to the
“Correct” URL of a GridField if it’s not found in the current list.

This works by:
 * Looking for the item in the database
 * If it exists, check for a CMSEditLink() method that returns a value
 * If so, redirect to that

This is useful if you have a number of grid fields that each show a
partial list of records, and it’s possible for the user to make changes
such the item no longer appears in the list, but does appear in another
list.

It’s an opt-in feature as I think all changes like this should be
opt-in, based on previous experiences improving GridField and in turn
breaking SecurityAdmin and slowing versioned-data-browsing down. ;-)
2021-05-21 13:16:00 +12:00
Ingo Schommer 8c0efd3980 Extension hooks for CsvBulkLoader
Required for versioned-snapshots integration
2021-05-21 11:17:46 +12:00
Ingo Schommer ad4e488dcf
Merge pull request #9192 from sminnee/fix-9163
NEW: Support dot syntax in form field names
2021-05-21 10:34:15 +12:00
Dylan Wagstaff a5fc61a23a
Merge pull request #9948 from open-sausages/4
FIX Tidy extension and cli fix for tests
2021-05-21 09:19:22 +12:00
Guy Marriott 766df06f23
Merge pull request #9631 from open-sausages/pulls/4/custom-sort-gridfield-autocompleter 2021-05-20 14:02:44 -07:00
Ingo Schommer 8806b3befc Fixes required for dot notation support in fields
See #9163
2021-05-20 20:32:25 +12:00
Dan Hensby 23ffd2bbd6 Linting fix 2021-05-20 20:32:25 +12:00
Sam Minnee 5dcf5197da FIX: Make the ./_ substitution optional. 2021-05-20 20:32:25 +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
Sam Minnee 6ba7bf7b2f FIX: Replace ‘.’s with ‘_’s in HTML IDs
The functioning of dot-syntax in form fields mean that .s are more
likely to appear in names. This breaks javascript behaviour in HTML IDs 
and I believe is an invalid character for them.
2021-05-20 20:32:24 +12:00
Sam Minnee 02fb7c3b17 NEW: Support dot syntax in form field names
This change adds support for these in a few places.

 - Form::saveInto($record)
 - Form::loadDataForm($record)
 - Form::loadDataForm($_POST)

Fixes https://github.com/silverstripe/silverstripe-framework/issues/9163
2021-05-20 20:32:24 +12:00
Ingo Schommer 5e2ca7f0a3 FIX Tidy extension and cli fix for tests
Wrap doesn't actually wrap in the tidy extension.
This causes tests to be flakey, for example some of `FormTest` fails
if you happen to have `ext-tidy` installed (which is the default on most systems).
This happened to me on PHP 7.4.19 with tidy 5.6.0 (OSX Homebrew).
Note that the tests aren't failing in Travis right now.

You'd expect `wrap => 0` to be honoured. It's documented as an integer
in the tidy docs: https://api.html-tidy.org/tidy/quickref_5.6.0.html#wrap.

Even tracked this down to the PHP source which appears to be doing the right thing:
https://github.com/php/php-src/blob/master/ext/tidy/tidy.c#L300

There's a bug from 2018 against PHP 7.2.8 which was closed as "not a bug" without comment:
https://bugs.php.net/bug.php?id=76683

You can see the behaviour in action in the following test.

```
<?php
$html = '<p>a really long string which should not be wrapped</p>';

echo "## With tidy extension" . PHP_EOL;
$tidy = new tidy();
$tidy->parseString(
    $html,
    [
        'output-xhtml' => true,
        'numeric-entities' => true,
        'wrap' => 0,
    ],
    'utf8'
);
$tidy->cleanRepair();
echo $tidy . PHP_EOL;

echo "## With tidy cli" . PHP_EOL;
$cmd = sprintf("echo " . escapeshellarg($html) . " | tidy --force-output 1 -n -q -utf8 -asxhtml -w 0 2> /dev/null");
echo shell_exec($cmd);
```

Long story short, setting it to 99999 fixes the issue.
2021-05-20 20:09:42 +12:00
Steve Boyd a6ccc86f94 Merge branch '4.7' into 4.8 2021-05-03 14:21:37 +12:00
Steve Boyd e6aeff6468 Merge branch '4.6' into 4.7 2021-05-03 14:21:20 +12:00
Garion Herman debf1ae9fb
Merge pull request #9887 from lekoala/patch-18 2021-04-24 21:05:29 +12:00
Maxime Rainville 67a008365a
Merge pull request #9743 from kinglozzer/treedropdown-root-id
NEW: Expose TreeDropdownField root node ID in schema
2021-04-23 18:06:23 +12:00
maks 12a6f7bd0f
fix typo in core constants phpdoc block 2021-04-20 18:25:24 +02:00
Maxime Rainville 37ee3a923f
Merge pull request #9917 from creative-commoners/pulls/4/rememberloginhash-getset
API Methods to override logout_accross_devices
2021-04-20 09:49:36 +12:00
Steve Boyd 3d7868449f Merge branch '4.7' into 4 2021-04-19 16:39:15 +12:00
Steve Boyd bcccc63d33 API Methods to override logout_accross_devices 2021-04-19 13:13:35 +12:00
Loz Calver 097da7aed5
Merge pull request #9916 from chrometoasters/bugfix/absolute-base-url-generation
[BUGFIX] Prevent call getHeader() on null HTTPRequest object
2021-04-16 09:15:15 +01:00
Maxime Rainville fdd23a3675 Merge branch '4.7' into 4 2021-04-14 11:35:58 +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
André Kiste e2777ded8e • Add missing string
• Move attribute to login-forms
2021-04-13 15:33:49 +12:00
Kunal Hari 31c5ab2069 [BUGFIX] Prevent call getHeader() on null HTTPRequest object 2021-04-13 14:06:21 +12:00
André Kiste bbcc187c02 Update conflicting translations.
Revert removal of translations.
2021-04-12 11:42:57 +12:00
Andre Kiste dcdc25500b
Merge pull request #9909 from creative-commoners/pulls/4/remember-thirty
ENH Reduce default token period from 90 to 30 days
2021-04-08 12:39:22 +12:00
André Kiste 8692aabe9b Use new designs 2021-04-08 12:32:12 +12:00
Steve Boyd 7ec838f9c2
Merge pull request #9908 from sunnysideup/patch-15
PATCH: fix param in docblock ... add \ to FormField::__construct
2021-04-07 09:56:40 +12:00
Steve Boyd 160ed6f3f1
Merge pull request #9882 from creative-commoners/pulls/4/doc-composite-validator
DOC Clarify return value for CompositeValidator::getValidatorsByType()
2021-04-06 15:26:16 +12:00
Steve Boyd 1c7fd287a1 ENH Reduce default token period from 90 to 30 days 2021-04-06 13:22:10 +12:00
Nicolaas b75860b195
PATCH: fix param in docblock ... add \ to FormField::__construct 2021-04-05 19:43:41 +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
Christopher Darling f1e5c72e43
BUG fieldNameError() references invalid $this->form
FieldList references `$this->form` which doesn't exist from what I can see. I presume this should have been `$field->getForm()`.

However, please note that I came across this when looking for something unrelated and haven't tested this PR.
2021-03-31 14:55:50 +01:00
Maxime Rainville 66fa597b3b
FIX Better handling of remember me token when login across devices is disabled (#9895)
* BUG Make sure remember me tokens are not invalidated when logging out without the logout_across_devices flag

* Remove unneeded comment
2021-03-31 11:31:52 +13:00
André Kiste 44fae4497b Better describe the 'keep me signed in' checkbox 2021-03-30 13:19:55 +13:00
Nicolaas 504e20320e
Update DBBoolean.php (#9893) 2021-03-24 12:05:33 +13:00
Brett Tasker 600f8e5b86 Move hasEmptySchem and emptyString to DataSchema on SingleSelectField 2021-03-23 21:53:30 +13:00
Steve Boyd 169c06131a
Merge pull request #9748 from tom890180/4.6
Merge the "Merge pull request #9565 from tom890180/check_items_exist" to 4.6
2021-03-23 11:01:30 +13:00
Christopher Darling daa9060c1a
remove unused class import Convert
Was missed from PR b02a6fa02d
2021-03-22 14:34:13 +00:00
Thomas Portelange 22b2d58b5a
Update src/Security/Member.php
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2021-03-22 09:02:18 +01:00
Thomas Portelange 19052e6924
Update src/Security/Member.php
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2021-03-22 09:02:13 +01:00
Thomas Portelange 0586c55e62
prevent spaces in emails
so this is not the first time a customer of mine is just copy pasting stuff in emails fields and somehow, a space at the end skips validation. this update ensure there is no space before or after the email, it would probably save a lot of time for everyone to have this build in.
it's probably better to fix it here rather than at form level because this also happens for csv imports etc
2021-03-19 10:11:02 +01:00
Maxime Rainville 7a04090bdf Merge branch '4.7' into 4 2021-03-15 14:27:47 +13:00
Maxime Rainville 4ee92da6b5 DOC Clarify return value for CompositeValidator::getValidatorsByType() 2021-03-10 22:59:06 +13:00
Nik d2fa64b489
BUG Allow Email to re-render when data changes (#9876)
* Fix: Allow Email to re-render when data changes

* Add invalidateBody function

* Make the linter happy
2021-03-04 11:18:46 +13:00
Maxime Rainville 2c54a3fd2f Merge branch '4.7' into 4 2021-03-01 20:37:04 +13:00
Maxime Rainville 028c4fdaa1 BUG Tweak shortcode parser so it properly parse empty attributes 2021-02-25 15:18:16 +13:00
Chris Penny 79d04fed0d CompositeValidator::validate() to call validate() instead of php() 2021-02-22 08:13:54 +13:00
Loz Calver 095a3b70f8 NEW: Provide helpers for isDev/isTest/isLive in templates 2021-02-11 11:19:07 +00:00
Guy Marriott eaadd40c3b
Merge pull request #9845 from HARVS1789UK/dataquery-exists-sql-portability-fix
Bug Fix - Ensure DataQuery::exists() SQL is both valid MySQL and T-SQL
2021-02-10 10:21:42 -08:00
Antony Thorpe 77ecbd854d
Updated TreeDropdownField.php documentation
Updated code example for SS4
2021-02-09 16:27:13 +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
Maxime Rainville 0dd59a1e7b
BUG Reset GridFieldFilterHeader grid state when search is cleared (#9829) 2021-01-21 13:47:40 +13:00
Maxime Rainville 54bdabd203 Merge branch '4.7' into 4 2021-01-20 12:57:01 +13:00
Maxime Rainville d13d3a1134
Merge pull request #9818 from creative-commoners/pulls/4.7/check-object-for-key
FIX Type checking in objectForKey() to fix postgres bug
2021-01-20 12:41:49 +13:00
Maxime Rainville 17c6f98ba2 BUG Fix PostgreSQL issue in TreeMultiselectField where field would try to filter list by a blank ID 2021-01-20 12:23:09 +13:00
Maxime Rainville 0da15f0f27 Merge branch '4.7' into 4 2021-01-19 15:33:56 +13: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
Ingo Schommer fe2027e486 PHPDoc in PEG parser
Required for https://github.com/silverstripe/silverstripe-framework/pull/9808
2021-01-14 11:07:58 +13:00
Ingo Schommer 5f7239fc3d
Merge pull request #9765 from open-sausages/pulls/4/test-setup-confusion
Warn on database misconfiguration in test runs
2021-01-14 09:18:14 +13:00
Steve Boyd 76ae5bc38a FIX Type checking in objectForKey() to fix postgres bug 2021-01-08 15:25:38 +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
Sam Minnée a8d121d23f
Merge pull request #9800 from creative-commoners/pulls/4.7/arraylist-value-set
FIX Bug when specifying 0 in ArrayList::offsetSet
2020-12-16 15:40:20 +13:00