Commit Graph

22534 Commits

Author SHA1 Message Date
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
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
7a0d354529 Linter fixes 2021-05-21 08:30:43 +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
Daniel Hensby
713a0b4a67
Merge pull request #9947 from chromos33/4
Update 04_Shortcodes.md
2021-05-19 19:24:31 +01:00
chromos33
ebdbbfd595
Update 04_Shortcodes.md 2021-05-19 19:16:27 +02:00
Steve Boyd
b6286983b1 Merge branch '4.8' into 4 2021-05-17 16:54:02 +12:00
Steve Boyd
787253d51c MNT Remove COMPOSER_ROOT_VERSION 2021-05-17 16:53:40 +12:00
Andre Kiste
6fd3a1aa05
Merge pull request #9944 from manuth/patch-16
Update 09_Casting.md
2021-05-17 15:57:23 +12:00
Andre Kiste
cb05744b7d
Merge pull request #9941 from manuth/patch-13
Update 03_Requirements.md
2021-05-17 15:26:50 +12:00
Andre Kiste
d7225f99fd
Merge pull request #9942 from manuth/patch-14
Update 05_Template_Inheritance.md
2021-05-17 15:26:25 +12:00
Andre Kiste
ee334025f0
Merge pull request #9943 from manuth/patch-15
Update 06_Themes.md
2021-05-17 15:25:19 +12:00
Steve Boyd
8b28c5647b MNT Added 4.8.0-rc1 changelog 2021-05-17 12:05:10 +12:00
Andre Kiste
7b57963182
Merge pull request #9938 from manuth/patch-10
Update index.md
2021-05-17 11:57:38 +12:00
Andre Kiste
1310252c7d
Merge pull request #9940 from manuth/patch-12
Update 02_Common_Variables.md
2021-05-17 11:51:24 +12:00
Andre Kiste
e98b7edc3e
Merge pull request #9939 from manuth/patch-11
Update 01_Syntax.md
2021-05-17 11:50:39 +12:00
Manuel Thalmann
3a49759c0f
Update 09_Casting.md 2021-05-17 01:34:01 +02:00
Manuel Thalmann
293f7e9d05
Update 06_Themes.md 2021-05-17 01:03:03 +02:00
Steve Boyd
dde1e7a5c2 Update translations 2021-05-17 10:53:21 +12:00
Manuel Thalmann
0d649e0dd8
Update 05_Template_Inheritance.md 2021-05-17 00:42:25 +02:00
Manuel Thalmann
deb767d9fc
Update 03_Requirements.md 2021-05-17 00:12:01 +02:00
Manuel Thalmann
64d569ee02
Update 02_Common_Variables.md 2021-05-16 22:22:53 +02:00
Manuel Thalmann
a1ace42294
Update 01_Syntax.md 2021-05-16 21:52:20 +02:00
Manuel Thalmann
c3ff7a417b
Update index.md 2021-05-16 20:52:27 +02:00
Daniel Hensby
1c1298e062
Merge pull request #9934 from manuth/patch-7
Update 11_Scaffolding.md
2021-05-14 20:57:56 +01:00
Daniel Hensby
045eaaaa79
Merge pull request #9933 from manuth/patch-6
Update 10_Versioning.md
2021-05-14 20:51:08 +01:00
Daniel Hensby
d3e1678823
Merge pull request #9935 from manuth/patch-8
Update Dynamic_Default_Fields.md
2021-05-14 20:23:26 +01:00
Manuel Thalmann
4f57bd94de
Apply further suggestion
Co-authored-by: Daniel Hensby <dhensby@users.noreply.github.com>
2021-05-14 20:22:23 +01:00
Manuel Thalmann
e37188da4c
Revert unnecessary change 2021-05-14 20:21:34 +01:00
Daniel Hensby
414a9e4ce2
Merge pull request #9936 from manuth/patch-9
Update Grouping_DataObject_Sets.md
2021-05-14 20:16:48 +01:00
Manuel Thalmann
4de89323f7
Update Grouping_DataObject_Sets.md 2021-05-14 15:43:44 +02:00
Manuel Thalmann
42f0957bd5
Update Dynamic_Default_Fields.md 2021-05-14 15:29:11 +02:00
Manuel Thalmann
ff7654db1f
Update 11_Scaffolding.md 2021-05-14 15:17:50 +02:00
Manuel Thalmann
b0cdff3619 Apply suggestions 2021-05-14 15:16:33 +02:00
Manuel Thalmann
ac7cbef6b9
Update 10_Versioning.md 2021-05-14 14:57:49 +02:00
Daniel Hensby
0a7570dd96
Merge pull request #9932 from manuth/patch-5
Update 08_SQL_Select.md
2021-05-14 10:32:21 +01:00
Manuel Thalmann
ff9fc28468
Update 08_SQL_Select.md 2021-05-14 11:14:35 +02:00
Daniel Hensby
2b0a7e21c7
Merge pull request #9931 from manuth/patch-4
Fix typos in 04_Data_Types_and_Casting.md
2021-05-14 09:47:54 +01:00
Manuel Thalmann
7024af541b
Fix typos in 04_Data_Types_and_Casting.md 2021-05-14 10:28:58 +02:00
Guy Marriott
c88592d768
Merge pull request #9930 from manuth/patch-3 2021-05-13 17:33:33 -07:00
Manuel Thalmann
6e499b73af
Fix typos in 03_Lists.md 2021-05-14 02:07:00 +02:00
Guy Marriott
07bcd041ab
Merge pull request #9928 from manuth/patch-2 2021-05-13 16:08:54 -07:00
Manuel Thalmann
ed50c1b94e
Update docs/en/02_Developer_Guides/00_Model/02_Relations.md
Co-authored-by: Guy Marriott <guy.the.person@gmail.com>
2021-05-13 23:19:37 +02:00
Guy Marriott
5031d2ae23
Merge pull request #9927 from manuth/patch-1
Fix typos in 01_Data_Model_and_ORM.md
2021-05-13 13:52:17 -07:00
Manuel Thalmann
a5e4a5c97d
Fix typos in 02_Relations.md 2021-05-13 22:05:17 +02:00
Manuel Thalmann
f44119ff59
Fix typos in 01_Data_Model_and_ORM.md 2021-05-13 21:18:40 +02:00
Guy Marriott
52c61b9c52
Merge pull request #9926 from danielpina/patch-2
Update 01_Validation.md
2021-05-11 11:12:30 -07:00
Daniel Pina
e7e586b8c3
Update 01_Validation.md 2021-05-11 18:48:51 +01:00
Steve Boyd
ff409d5e31 Merge branch '4.8' into 4 2021-05-03 14:21:53 +12:00