Commit Graph

666 Commits

Author SHA1 Message Date
Steve Boyd 4d662d2dea Merge branch '4.11' into 4 2022-06-28 17:42:07 +12:00
Steve Boyd 98b985fb91 Merge branch '4.10' into 4.11 2022-06-28 17:41:49 +12:00
Guy Sartorelli 794640247b
Merge pull request #10374 from creative-commoners/pulls/4.10/cve-2022-28803
[CVE-2022-28803] Block XSS in links and iframes.
2022-06-28 17:27:37 +12:00
Steve Boyd 991aedf017 [CVE-2022-25238] Sanitise htmlfields serverside by default 2022-06-28 17:03:05 +12:00
Guy Sartorelli d2c58f3bbc [CVE-2022-28803] Block XSS in links and iframes. 2022-06-28 17:01:53 +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
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
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
Guy Sartorelli 5436df57e4 FIX Add polymorphic class on new records for use in forms. 2022-05-11 14:04:52 +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
Steve Boyd 511b3bb060 ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +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
Steve Boyd 740d087e97 FIX Default GridField search fields with an index of 0 to use StartWithFilter 2022-03-22 16:17:37 +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
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
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
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 048eb4b614 ENH Improve gridfield export pefromance by using DataList generator 2022-01-12 07:01:00 +13:00
Loz Calver cb37e5fb87 FIX: Ensure extra classes are copied over to readonly/disabled fields 2021-12-17 09:16:43 +00:00
Lukas 552cf5944d
MNT Fix various typos with codespell (#10177) 2021-12-13 21:05:33 +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 b43d68f9b4 API Add an AttributesHTML trait 2021-11-18 15:31:01 +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
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
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
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 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
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
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 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
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
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 9463aaf571 Merge branch '4.8' into 4 2021-06-08 11:49:01 +12:00
Steve Boyd 8024551376 [CVE-2020-26138] Validate custom multi-file uploads 2021-06-02 16:24:23 +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 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
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 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
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
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
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
Nicolaas b75860b195
PATCH: fix param in docblock ... add \ to FormField::__construct 2021-04-05 19:43:41 +12: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
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
Maxime Rainville 4ee92da6b5 DOC Clarify return value for CompositeValidator::getValidatorsByType() 2021-03-10 22:59:06 +13:00
Chris Penny 79d04fed0d CompositeValidator::validate() to call validate() instead of php() 2021-02-22 08:13:54 +13:00
Antony Thorpe 77ecbd854d
Updated TreeDropdownField.php documentation
Updated code example for SS4
2021-02-09 16:27:13 +13: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 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
Steve Boyd 76ae5bc38a FIX Type checking in objectForKey() to fix postgres bug 2021-01-08 15:25:38 +13:00
William Desportes c932d7e7fb
Fix the phpdoc blocks 2020-12-21 22:23:23 +01:00
Andre Kiste 460715197d
Merge pull request #9190 from open-sausages/pulls/4/test-state
Don't include default value in url grid state
2020-11-18 12:31:50 +13:00
Steve Boyd ad839fdd6e Merge branch '4.6' into 4.7 2020-11-16 12:10:48 +13:00
Guy Marriott bdeb0aab4f Merge pull request #9565 from tom890180/check_items_exist 2020-10-28 10:27:10 +02:00
Loz Calver eedad00ebe NEW: Expose TreeDropdownField root node ID in schema
Forms part of a fix for silverstripe-admin#954
2020-10-22 15:14:15 +01:00
Steve Boyd 0e064300d9 ENH Add disabled attribute to SelectionGroup 2020-10-22 21:15:50 +13:00
Serge Latyntcev 58ed426653 FIX TinyMCEConfig image size presets handle incorrect values 2020-10-12 17:31:59 +13:00
Serge Latyntcev 034bace213 FIX TinyMCEConfig image size presets handle incorrect values 2020-10-12 16:54:29 +13:00
Robbie Averill 27bd5d12e3 ENH Replace E_USER_ERROR errors with exceptions 2020-09-24 23:51:21 -07:00
Dan Hensby ae0ece2b02
Merge pull request #9665 from creative-commoners/pulls/4/php8-fqcn-token 2020-09-18 20:44:22 +01:00
Sam Minnee b3dd27953b NEW: Allow league/csv ^9
Hopefully this has better PHP 8 support.
2020-09-15 17:40:42 +12:00
Steve Boyd 015ea8cfc8 Merge branch '4.6' into 4 2020-09-11 11:54:23 +12:00
Damian Mooyman ac6f34846e
BUG Resolve issue where TreeMultiSelectField would error loading its value (#9604)
* BUG Resolve issue with TreeMultiSelectField not retaining value in some situations
E.g. in an elemental form
2020-09-11 11:52:36 +12:00
Maxime Rainville 5226d961e8 Fix unit test 2020-08-18 10:29:57 +12:00
Maxime Rainville a43414dedb Make sure GridState always outputs a JSON Object string 2020-08-17 23:23:42 +12:00
Maxime Rainville 70ffb3297a API Only include gridfield state value that differ from the expected default 2020-08-17 12:11:56 +12:00
Ingo Schommer 9d03a6856c FIX Retain custom sort on custom lists in GridFieldAddExistingAutoCompleter
Forcing sort by the first search field isn't always appropriate.
When a custom search list is used, we can set the expectation that custom sorting is intended as well.
As an example, this can be used to autocomplete based on FULLTEXT indexes,
and sort based on relevancy.
2020-08-04 22:02:20 +12:00
Steve Boyd 8287fad24d Merge branch '4.6' into 4 2020-07-29 11:38:49 +12:00
Nicolaas f264ff8616
PATCH: improving @return values in docblocks 2020-07-23 22:40:14 +12:00
Martin Heise 404f450ac3 BUG Readonly version of GroupedDropdownField
GroupedDropdownField was showing empty values in Readonly mode due to not correctly handling the hierarchical source array.
Uses flattened source now in GroupedDropdownField->performReadonlyTransformation()
2020-07-21 09:23:30 +02:00
Robbie Averill 84b4057a9a
Merge pull request #9406 from chrispenny/feature/standardise-get-cms-validator
v4 improvement: Standardise getCMSValidator for DataObjects/Forms
2020-07-16 15:58:33 -07:00
Ingo Schommer 8d6a248431 Merge remote-tracking branch 'origin/4.6' into 4 2020-07-11 09:07:39 +12:00
Ingo Schommer 1f0a78e57b FIX More context for GridFieldDataColumns callbacks
This emulates the callback signature from
GridFieldEditableColumns in the symbiote/silverstripe-gridfieldextensions module, which extends GridFieldDataColumns. In case canEdit() fails, this component passes control back to the parent (rendering a standard column content rather than a formfield). Which can become an issue if you've defined custom 'callback' handlers on setDisplayFields() - GridFieldDataColumns passes in only one arg (`$record`), while GridFieldEditableColumns passes in three (`$record`, `$col` and `$grid`).

While you could argue that this is a bug in the other module,
I think this additional context is beneficial for the main
GridFieldDataColumns use case as well, and it just happens to fix that bug.
2020-07-09 09:33:21 +12:00