From ab4aafe85325201f1587c9e72038226c7e3a10a9 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sat, 4 Jan 2014 22:10:07 +0300 Subject: [PATCH 1/6] correct overriden option of button and add checkbox overriden option --- reference/forms/types/button.rst | 2 +- reference/forms/types/checkbox.rst | 13 +++++++++++-- .../forms/types/options/checkbox_compound.rst.inc | 6 ++++++ .../forms/types/options/checkbox_empty_data.rst.inc | 6 ++++++ 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 reference/forms/types/options/checkbox_compound.rst.inc create mode 100644 reference/forms/types/options/checkbox_empty_data.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 18cbbd3103f..1db55d124eb 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -18,7 +18,7 @@ A simple, non-responsive button. | | - `label_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ -| Overridden Options | - `auto_initialize` | +| Overriden options | - `auto_initialize`_ | +----------------------+----------------------------------------------------------------------+ | Parent type | none | +----------------------+----------------------------------------------------------------------+ diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index 159ef755c30..2437d3b005a 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -13,9 +13,11 @@ if the box is unchecked, the value will be set to false. +-------------+------------------------------------------------------------------------+ | Options | - `value`_ | +-------------+------------------------------------------------------------------------+ +| Overriden | - `empty_data`_ | +| options | - `compound`_ | ++-------------+------------------------------------------------------------------------+ | Inherited | - `data`_ | -| options | - `empty_data`_ | -| | - `required`_ | +| options | - `required`_ | | | - `label`_ | | | - `label_attr`_ | | | - `read_only`_ | @@ -44,6 +46,13 @@ Field Options .. include:: /reference/forms/types/options/value.rst.inc +Overriden options +----------------- + +.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc + +.. include:: /reference/forms/types/options/checkbox_compound.rst.inc + Inherited options ----------------- diff --git a/reference/forms/types/options/checkbox_compound.rst.inc b/reference/forms/types/options/checkbox_compound.rst.inc new file mode 100644 index 00000000000..e7149eb8924 --- /dev/null +++ b/reference/forms/types/options/checkbox_compound.rst.inc @@ -0,0 +1,6 @@ +compound +~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Specify that checkbox type is not a combined type. diff --git a/reference/forms/types/options/checkbox_empty_data.rst.inc b/reference/forms/types/options/checkbox_empty_data.rst.inc new file mode 100644 index 00000000000..987d7247458 --- /dev/null +++ b/reference/forms/types/options/checkbox_empty_data.rst.inc @@ -0,0 +1,6 @@ +empty_data +~~~~~~~~~~ + +**type**: ``closure`` + + From c62cd13cd6f00b4226cb8c1c55b636b5f1e46eb2 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sat, 4 Jan 2014 22:10:07 +0300 Subject: [PATCH 2/6] correct overriden option of button and add checkbox overriden option --- reference/forms/types/checkbox.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index 2437d3b005a..fc57f624b5d 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -13,7 +13,7 @@ if the box is unchecked, the value will be set to false. +-------------+------------------------------------------------------------------------+ | Options | - `value`_ | +-------------+------------------------------------------------------------------------+ -| Overriden | - `empty_data`_ | +| Overridden | - `empty_data`_ | | options | - `compound`_ | +-------------+------------------------------------------------------------------------+ | Inherited | - `data`_ | @@ -53,6 +53,13 @@ Overriden options .. include:: /reference/forms/types/options/checkbox_compound.rst.inc +Overriden options +----------------- + +.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc + +.. include:: /reference/forms/types/options/checkbox_compound.rst.inc + Inherited options ----------------- From 70feefd2b96f1123da54b52ebaa552ca766d59fe Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sun, 12 Jan 2014 07:35:13 +0300 Subject: [PATCH 3/6] document overriden options of checkbox --- reference/forms/types/options/checkbox_compound.rst.inc | 4 +++- reference/forms/types/options/checkbox_empty_data.rst.inc | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/options/checkbox_compound.rst.inc b/reference/forms/types/options/checkbox_compound.rst.inc index e7149eb8924..855969d870c 100644 --- a/reference/forms/types/options/checkbox_compound.rst.inc +++ b/reference/forms/types/options/checkbox_compound.rst.inc @@ -3,4 +3,6 @@ compound **type**: ``boolean`` **default**: ``false`` -Specify that checkbox type is not a combined type. +This option specifies if a form is compound. As it's not the +case for checkbox, by fefault the value is overriden with +``false`` value. diff --git a/reference/forms/types/options/checkbox_empty_data.rst.inc b/reference/forms/types/options/checkbox_empty_data.rst.inc index 987d7247458..fa7f23d5ca3 100644 --- a/reference/forms/types/options/checkbox_empty_data.rst.inc +++ b/reference/forms/types/options/checkbox_empty_data.rst.inc @@ -1,6 +1,10 @@ empty_data ~~~~~~~~~~ -**type**: ``closure`` +**type**: ``string`` **default**: ``mixed`` +This option determines what value the field will return when the ``empty_value`` +choice is selected. +In checkbox, the value of ``empty_data`` is overriden by the value returned by +the data transformer (see :doc:`/cookbook/form/data_transformers.rst`). From 362c8b4876fd17242fe65841964160129cfba8d0 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Sun, 12 Jan 2014 08:12:10 +0300 Subject: [PATCH 4/6] document overriden options of choice field --- reference/forms/types/choice.rst | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index b69e48c32ed..32d364a8e2d 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -20,18 +20,20 @@ option. | | - `preferred_choices`_ | | | - `empty_value`_ | +-------------+------------------------------------------------------------------------------+ +| Overriden | - `empty_data`_ | +| options | - `compound`_ | +| | - `error_bubbling`_ | ++-------------+------------------------------------------------------------------------------+ | Inherited | - `required`_ | | options | - `label`_ | | | - `label_attr`_ | | | - `data`_ | | | - `read_only`_ | | | - `disabled`_ | -| | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `mapped`_ | | | - `inherit_data`_ | | | - `by_reference`_ | -| | - `empty_data`_ | +-------------+------------------------------------------------------------------------------+ | Parent type | :doc:`form ` | +-------------+------------------------------------------------------------------------------+ @@ -109,6 +111,27 @@ can be created to supply the choices. .. include:: /reference/forms/types/options/empty_value.rst.inc +Overriden options +----------------- + +.. include:: /reference/forms/types/options/empty_data.rst.inc + +compound +~~~~~~~~ + +**type**: `̀ boolean`` **default**: same value as ``expanded`` option + +This option specifies if a form is compound. The value is by default +overriden by the value of the ``expanded`` option. + +error_bubbling +~~~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Set that error on this field must be attached to the field instead of +the parent field (the form in most cases). + Inherited options ----------------- @@ -126,8 +149,6 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/disabled.rst.inc -.. include:: /reference/forms/types/options/error_bubbling.rst.inc - .. include:: /reference/forms/types/options/error_mapping.rst.inc .. include:: /reference/forms/types/options/mapped.rst.inc @@ -135,5 +156,3 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/inherit_data.rst.inc .. include:: /reference/forms/types/options/by_reference.rst.inc - -.. include:: /reference/forms/types/options/empty_data.rst.inc From 4f6cb9dd1778bcb270a0a82ff4ca55a133e4a180 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Wed, 22 Jan 2014 15:55:02 -0600 Subject: [PATCH 5/6] Some additional tweaks and probably some merge conflict fixes --- reference/forms/types/button.rst | 2 +- reference/forms/types/checkbox.rst | 11 ++--------- reference/forms/types/choice.rst | 8 ++++---- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 1db55d124eb..d688598008a 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -18,7 +18,7 @@ A simple, non-responsive button. | | - `label_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ -| Overriden options | - `auto_initialize`_ | +| Overridden options | - `auto_initialize`_ | +----------------------+----------------------------------------------------------------------+ | Parent type | none | +----------------------+----------------------------------------------------------------------+ diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index fc57f624b5d..aeefb915ccf 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -46,15 +46,8 @@ Field Options .. include:: /reference/forms/types/options/value.rst.inc -Overriden options ------------------ - -.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc - -.. include:: /reference/forms/types/options/checkbox_compound.rst.inc - -Overriden options ------------------ +Overridden options +------------------ .. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 32d364a8e2d..c60b2f29f55 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -20,7 +20,7 @@ option. | | - `preferred_choices`_ | | | - `empty_value`_ | +-------------+------------------------------------------------------------------------------+ -| Overriden | - `empty_data`_ | +| Overridden | - `empty_data`_ | | options | - `compound`_ | | | - `error_bubbling`_ | +-------------+------------------------------------------------------------------------------+ @@ -111,15 +111,15 @@ can be created to supply the choices. .. include:: /reference/forms/types/options/empty_value.rst.inc -Overriden options ------------------ +Overridden options +------------------ .. include:: /reference/forms/types/options/empty_data.rst.inc compound ~~~~~~~~ -**type**: `̀ boolean`` **default**: same value as ``expanded`` option +**type**: ``boolean`` **default**: same value as ``expanded`` option This option specifies if a form is compound. The value is by default overriden by the value of the ``expanded`` option. From e574e97938168ca079a08448c3f7b635a3187bfa Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 2 Feb 2014 21:36:14 -0600 Subject: [PATCH 6/6] Removing an extra line thanks to @xabbuh --- reference/forms/types/options/checkbox_empty_data.rst.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/forms/types/options/checkbox_empty_data.rst.inc b/reference/forms/types/options/checkbox_empty_data.rst.inc index fa7f23d5ca3..8143ad364ce 100644 --- a/reference/forms/types/options/checkbox_empty_data.rst.inc +++ b/reference/forms/types/options/checkbox_empty_data.rst.inc @@ -7,4 +7,3 @@ This option determines what value the field will return when the ``empty_value`` choice is selected. In checkbox, the value of ``empty_data`` is overriden by the value returned by the data transformer (see :doc:`/cookbook/form/data_transformers.rst`). -