Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 350d4e0

Browse filesBrowse files
committed
minor #16120 Split a conditional doc include into two separate doc includes (javiereguiluz)
This PR was merged into the 4.4 branch. Discussion ---------- Split a conditional doc include into two separate doc includes Fixes #15988, #15976, #16081, #16095 and many other bug reports. We won't be able to add support for this in the RST parser soon ... and maybe we shouldn't, because this is a rarely used feature that can be solved in a different way, as shown in this PR. Commits ------- 3480f69 Split a conditional doc include into two separate doc includes
2 parents b043aa3 + 3480f69 commit 350d4e0
Copy full SHA for 350d4e0
Expand file treeCollapse file tree

26 files changed

+52
-107
lines changed

‎reference/forms/types/choice.rst

Copy file name to clipboardExpand all lines: reference/forms/types/choice.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,15 @@ compound
226226
This option specifies if a form is compound. The value is by default
227227
overridden by the value of the ``expanded`` option.
228228

229-
.. include:: /reference/forms/types/options/empty_data.rst.inc
230-
:end-before: DEFAULT_PLACEHOLDER
229+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
231230

232231
The actual default value of this option depends on other field options:
233232

234233
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
235234
(empty string);
236235
* Otherwise ``[]`` (empty array).
237236

238-
.. include:: /reference/forms/types/options/empty_data.rst.inc
239-
:start-after: DEFAULT_PLACEHOLDER
237+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
240238

241239
error_bubbling
242240
~~~~~~~~~~~~~~

‎reference/forms/types/collection.rst

Copy file name to clipboardExpand all lines: reference/forms/types/collection.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,11 @@ Not all options are listed here - only the most applicable to this type:
384384

385385
.. include:: /reference/forms/types/options/by_reference.rst.inc
386386

387-
.. include:: /reference/forms/types/options/empty_data.rst.inc
388-
:end-before: DEFAULT_PLACEHOLDER
387+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
389388

390389
The default value is ``[]`` (empty array).
391390

392-
.. include:: /reference/forms/types/options/empty_data.rst.inc
393-
:start-after: DEFAULT_PLACEHOLDER
391+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
394392

395393
error_bubbling
396394
~~~~~~~~~~~~~~

‎reference/forms/types/color.rst

Copy file name to clipboardExpand all lines: reference/forms/types/color.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
3535

3636
.. include:: /reference/forms/types/options/disabled.rst.inc
3737

38-
.. include:: /reference/forms/types/options/empty_data.rst.inc
39-
:end-before: DEFAULT_PLACEHOLDER
38+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
4039

4140
The default value is ``''`` (the empty string).
4241

43-
.. include:: /reference/forms/types/options/empty_data.rst.inc
44-
:start-after: DEFAULT_PLACEHOLDER
42+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
4543

4644
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
4745

‎reference/forms/types/country.rst

Copy file name to clipboardExpand all lines: reference/forms/types/country.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,15 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
9191

9292
.. include:: /reference/forms/types/options/disabled.rst.inc
9393

94-
.. include:: /reference/forms/types/options/empty_data.rst.inc
95-
:end-before: DEFAULT_PLACEHOLDER
94+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
9695

9796
The actual default value of this option depends on other field options:
9897

9998
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
10099
(empty string);
101100
* Otherwise ``[]`` (empty array).
102101

103-
.. include:: /reference/forms/types/options/empty_data.rst.inc
104-
:start-after: DEFAULT_PLACEHOLDER
102+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
105103

106104
.. include:: /reference/forms/types/options/help.rst.inc
107105

‎reference/forms/types/currency.rst

Copy file name to clipboardExpand all lines: reference/forms/types/currency.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,15 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
6868

6969
.. include:: /reference/forms/types/options/disabled.rst.inc
7070

71-
.. include:: /reference/forms/types/options/empty_data.rst.inc
72-
:end-before: DEFAULT_PLACEHOLDER
71+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
7372

7473
The actual default value of this option depends on other field options:
7574

7675
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
7776
(empty string);
7877
* Otherwise ``[]`` (empty array).
7978

80-
.. include:: /reference/forms/types/options/empty_data.rst.inc
81-
:start-after: DEFAULT_PLACEHOLDER
79+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
8280

8381
.. include:: /reference/forms/types/options/help.rst.inc
8482

‎reference/forms/types/email.rst

Copy file name to clipboardExpand all lines: reference/forms/types/email.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
2828

2929
.. include:: /reference/forms/types/options/disabled.rst.inc
3030

31-
.. include:: /reference/forms/types/options/empty_data.rst.inc
32-
:end-before: DEFAULT_PLACEHOLDER
31+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
3332

3433
The default value is ``''`` (the empty string).
3534

36-
.. include:: /reference/forms/types/options/empty_data.rst.inc
37-
:start-after: DEFAULT_PLACEHOLDER
35+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
3836

3937
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
4038

‎reference/forms/types/entity.rst

Copy file name to clipboardExpand all lines: reference/forms/types/entity.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,17 +288,15 @@ type:
288288

289289
.. include:: /reference/forms/types/options/disabled.rst.inc
290290

291-
.. include:: /reference/forms/types/options/empty_data.rst.inc
292-
:end-before: DEFAULT_PLACEHOLDER
291+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
293292

294293
The actual default value of this option depends on other field options:
295294

296295
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
297296
(empty string);
298297
* Otherwise ``[]`` (empty array).
299298

300-
.. include:: /reference/forms/types/options/empty_data.rst.inc
301-
:start-after: DEFAULT_PLACEHOLDER
299+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
302300

303301
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
304302

‎reference/forms/types/form.rst

Copy file name to clipboardExpand all lines: reference/forms/types/form.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ option on the form.
4949

5050
.. _reference-form-option-empty-data:
5151

52-
.. include:: /reference/forms/types/options/empty_data.rst.inc
53-
:end-before: DEFAULT_PLACEHOLDER
52+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
5453

5554
The actual default value of this option depends on other field options:
5655

@@ -61,8 +60,7 @@ The actual default value of this option depends on other field options:
6160
* If ``data_class`` is not set and ``compound`` is ``false``, then ``''``
6261
(empty string).
6362

64-
.. include:: /reference/forms/types/options/empty_data.rst.inc
65-
:start-after: DEFAULT_PLACEHOLDER
63+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
6664

6765
.. _reference-form-option-error-bubbling:
6866

‎reference/forms/types/hidden.rst

Copy file name to clipboardExpand all lines: reference/forms/types/hidden.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
4444

4545
.. include:: /reference/forms/types/options/data.rst.inc
4646

47-
.. include:: /reference/forms/types/options/empty_data.rst.inc
48-
:end-before: DEFAULT_PLACEHOLDER
47+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
4948

5049
The default value is ``''`` (the empty string).
5150

52-
.. include:: /reference/forms/types/options/empty_data.rst.inc
53-
:start-after: DEFAULT_PLACEHOLDER
51+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
5452

5553
.. include:: /reference/forms/types/options/error_mapping.rst.inc
5654

‎reference/forms/types/integer.rst

Copy file name to clipboardExpand all lines: reference/forms/types/integer.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
8888

8989
.. include:: /reference/forms/types/options/disabled.rst.inc
9090

91-
.. include:: /reference/forms/types/options/empty_data.rst.inc
92-
:end-before: DEFAULT_PLACEHOLDER
91+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
9392

9493
The default value is ``''`` (the empty string).
9594

96-
.. include:: /reference/forms/types/options/empty_data.rst.inc
97-
:start-after: DEFAULT_PLACEHOLDER
95+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
9896

9997
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
10098

‎reference/forms/types/language.rst

Copy file name to clipboardExpand all lines: reference/forms/types/language.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,15 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
9393

9494
.. include:: /reference/forms/types/options/disabled.rst.inc
9595

96-
.. include:: /reference/forms/types/options/empty_data.rst.inc
97-
:end-before: DEFAULT_PLACEHOLDER
96+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
9897

9998
The actual default value of this option depends on other field options:
10099

101100
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
102101
(empty string);
103102
* Otherwise ``[]`` (empty array).
104103

105-
.. include:: /reference/forms/types/options/empty_data.rst.inc
106-
:start-after: DEFAULT_PLACEHOLDER
104+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
107105

108106
.. include:: /reference/forms/types/options/help.rst.inc
109107

‎reference/forms/types/locale.rst

Copy file name to clipboardExpand all lines: reference/forms/types/locale.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,15 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
8181

8282
.. include:: /reference/forms/types/options/disabled.rst.inc
8383

84-
.. include:: /reference/forms/types/options/empty_data.rst.inc
85-
:end-before: DEFAULT_PLACEHOLDER
84+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
8685

8786
The actual default value of this option depends on other field options:
8887

8988
* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''``
9089
(empty string);
9190
* Otherwise ``[]`` (empty array).
9291

93-
.. include:: /reference/forms/types/options/empty_data.rst.inc
94-
:start-after: DEFAULT_PLACEHOLDER
92+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
9593

9694
.. include:: /reference/forms/types/options/help.rst.inc
9795

‎reference/forms/types/money.rst

Copy file name to clipboardExpand all lines: reference/forms/types/money.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
8989

9090
.. include:: /reference/forms/types/options/disabled.rst.inc
9191

92-
.. include:: /reference/forms/types/options/empty_data.rst.inc
93-
:end-before: DEFAULT_PLACEHOLDER
92+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
9493

9594
The default value is ``''`` (the empty string).
9695

97-
.. include:: /reference/forms/types/options/empty_data.rst.inc
98-
:start-after: DEFAULT_PLACEHOLDER
96+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
9997

10098
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
10199

‎reference/forms/types/number.rst

Copy file name to clipboardExpand all lines: reference/forms/types/number.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
7878

7979
.. include:: /reference/forms/types/options/disabled.rst.inc
8080

81-
.. include:: /reference/forms/types/options/empty_data.rst.inc
82-
:end-before: DEFAULT_PLACEHOLDER
81+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
8382

8483
The default value is ``''`` (the empty string).
8584

86-
.. include:: /reference/forms/types/options/empty_data.rst.inc
87-
:start-after: DEFAULT_PLACEHOLDER
85+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
8886

8987
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
9088

+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``empty_data``
2+
~~~~~~~~~~~~~~
3+
4+
**type**: ``mixed``

‎reference/forms/types/options/empty_data.rst.inc renamed to ‎reference/forms/types/options/empty_data_description.rst.inc

Copy file name to clipboardExpand all lines: reference/forms/types/options/empty_data_description.rst.inc
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
``empty_data``
2-
~~~~~~~~~~~~~~
3-
4-
**type**: ``mixed``
5-
6-
.. This file should only be included with start-after or end-before that's
7-
set to this placeholder value. Its purpose is to let us include only
8-
part of this file.
9-
10-
DEFAULT_PLACEHOLDER
11-
121
This option determines what value the field will *return* when the submitted
132
value is empty (or missing). It does not set an initial value if none is
143
provided when the form is rendered in a view.

‎reference/forms/types/password.rst

Copy file name to clipboardExpand all lines: reference/forms/types/password.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
5353

5454
.. include:: /reference/forms/types/options/disabled.rst.inc
5555

56-
.. include:: /reference/forms/types/options/empty_data.rst.inc
57-
:end-before: DEFAULT_PLACEHOLDER
56+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
5857

5958
The default value is ``''`` (the empty string).
6059

61-
.. include:: /reference/forms/types/options/empty_data.rst.inc
62-
:start-after: DEFAULT_PLACEHOLDER
60+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
6361

6462
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
6563

‎reference/forms/types/percent.rst

Copy file name to clipboardExpand all lines: reference/forms/types/percent.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
8383

8484
.. include:: /reference/forms/types/options/disabled.rst.inc
8585

86-
.. include:: /reference/forms/types/options/empty_data.rst.inc
87-
:end-before: DEFAULT_PLACEHOLDER
86+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
8887

8988
The default value is ``''`` (the empty string).
9089

91-
.. include:: /reference/forms/types/options/empty_data.rst.inc
92-
:start-after: DEFAULT_PLACEHOLDER
90+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
9391

9492
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
9593

‎reference/forms/types/range.rst

Copy file name to clipboardExpand all lines: reference/forms/types/range.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
4343

4444
.. include:: /reference/forms/types/options/disabled.rst.inc
4545

46-
.. include:: /reference/forms/types/options/empty_data.rst.inc
47-
:end-before: DEFAULT_PLACEHOLDER
46+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
4847

4948
The default value is ``''`` (the empty string).
5049

51-
.. include:: /reference/forms/types/options/empty_data.rst.inc
52-
:start-after: DEFAULT_PLACEHOLDER
50+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
5351

5452
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
5553

‎reference/forms/types/search.rst

Copy file name to clipboardExpand all lines: reference/forms/types/search.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
2828

2929
.. include:: /reference/forms/types/options/disabled.rst.inc
3030

31-
.. include:: /reference/forms/types/options/empty_data.rst.inc
32-
:end-before: DEFAULT_PLACEHOLDER
31+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
3332

3433
The default value is ``''`` (the empty string).
3534

36-
.. include:: /reference/forms/types/options/empty_data.rst.inc
37-
:start-after: DEFAULT_PLACEHOLDER
35+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
3836

3937
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
4038

‎reference/forms/types/tel.rst

Copy file name to clipboardExpand all lines: reference/forms/types/tel.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
3434

3535
.. include:: /reference/forms/types/options/disabled.rst.inc
3636

37-
.. include:: /reference/forms/types/options/empty_data.rst.inc
38-
:end-before: DEFAULT_PLACEHOLDER
37+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
3938

4039
The default value is ``''`` (the empty string).
4140

42-
.. include:: /reference/forms/types/options/empty_data.rst.inc
43-
:start-after: DEFAULT_PLACEHOLDER
41+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
4442

4543
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
4644

‎reference/forms/types/text.rst

Copy file name to clipboardExpand all lines: reference/forms/types/text.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
2727

2828
.. include:: /reference/forms/types/options/disabled.rst.inc
2929

30-
.. include:: /reference/forms/types/options/empty_data.rst.inc
31-
:end-before: DEFAULT_PLACEHOLDER
30+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
3231

3332
From an HTTP perspective, submitted data is always a string or an array of strings.
3433
So by default, the form will treat any empty string as null. If you prefer to get
3534
an empty string, explicitly set the ``empty_data`` option to an empty string.
3635

37-
.. include:: /reference/forms/types/options/empty_data.rst.inc
38-
:start-after: DEFAULT_PLACEHOLDER
36+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
3937

4038
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
4139

‎reference/forms/types/textarea.rst

Copy file name to clipboardExpand all lines: reference/forms/types/textarea.rst
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
3333

3434
.. include:: /reference/forms/types/options/disabled.rst.inc
3535

36-
.. include:: /reference/forms/types/options/empty_data.rst.inc
37-
:end-before: DEFAULT_PLACEHOLDER
36+
.. include:: /reference/forms/types/options/empty_data_declaration.rst.inc
3837

3938
The default value is ``''`` (the empty string).
4039

41-
.. include:: /reference/forms/types/options/empty_data.rst.inc
42-
:start-after: DEFAULT_PLACEHOLDER
40+
.. include:: /reference/forms/types/options/empty_data_description.rst.inc
4341

4442
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
4543

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.