Commit Graph

233 Commits

Author SHA1 Message Date
Steve Boyd 137ebcebec API Stop using deprecated API 2022-11-15 18:20:54 +13:00
Steve Boyd 9c453abf89 API Update deprecations 2022-10-13 14:49:15 +13:00
Steve Boyd 7b87926428 ENH Update deprecation messages 2022-10-13 14:05:49 +13:00
Steve Boyd cc49036616 ENH Standardise deprecation messages 2022-10-13 14:05:49 +13:00
Viktor Szépe 94d1ac8d99
ENH Various changes via static analysis tooling 2022-08-24 12:14:32 +12:00
Sabina Talipova c0b38fc411 ENH Update page number in the state on reaching the first or the last element in a list 2022-08-22 12:44:11 +12:00
Steve Boyd c466ca5ca5
Merge pull request #9341 from unclecheese/pulls/4/come-on-baby-make-it-search-so-good
NEW: Allow search field customisation
2022-08-02 11:59:55 +12:00
Guy Sartorelli c7504aa337
Merge pull request #10331 from creative-commoners/pulls/4/gridfield-keep-state
ENH Restore gridfield state from get vars (POC)
2022-07-29 11:33:19 +12:00
Sabina Talipova 7a9bc7f577 ENH Keep Request in URL 2022-07-28 10:14:43 +12:00
Aaron Carlino 07a6c1191a NEW: Allow search field customisation in GridFieldFilterHeader 2022-07-25 17:33:09 +12:00
Steve Boyd b62c4a9f53 Merge branch '4.11' into 4 2022-07-08 17:13:31 +12:00
Sabina Talipova babc811381 FIX Remove unexpected message 2022-07-04 16:05:57 +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
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
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
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
Mojmir Fendek 048eb4b614 ENH Improve gridfield export pefromance by using DataList generator 2022-01-12 07:01:00 +13: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
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 9b42624616
Merge pull request #9994 from GuySartorelli/patch-1
ENH Provide onBeforeRenderHolder extension hook in GridField.
2021-08-06 09:47:53 +12: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
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
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
Guy Marriott 766df06f23
Merge pull request #9631 from open-sausages/pulls/4/custom-sort-gridfield-autocompleter 2021-05-20 14:02:44 -07:00
Christopher Darling daa9060c1a
remove unused class import Convert
Was missed from PR b02a6fa02d
2021-03-22 14:34:13 +00:00
Maxime Rainville 0dd59a1e7b
BUG Reset GridFieldFilterHeader grid state when search is cleared (#9829) 2021-01-21 13:47:40 +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
Sam Minnee b3dd27953b NEW: Allow league/csv ^9
Hopefully this has better PHP 8 support.
2020-09-15 17:40:42 +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
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
Tom Yrjas 00ee8d8abf BUGFIX: Re-declare $items to be an ArrayList if it's null
getBackLink() modified to tolerate empty ArrayList
2020-06-29 16:07:24 +03:00
Tom Yrjas 824b5e0b67 BUGFIX: Ensure $items isn't null in GridFieldDetailForm_ItemRequest->Breadcrumbs() prior to performing operations on it. 2020-06-29 14:13:49 +03:00
Guy Marriott 1a6e2da995
Merge pull request #9543 from jakxnz/pulls/4.6/undeclared-private-statics 2020-06-15 23:16:57 -07:00