Skip to content

Added caution block under delete_empty to warn the developer when he try to activate delete_empty for collections of compound forms #7767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor reword
  • Loading branch information
javiereguiluz authored Apr 8, 2017
commit de25ede4310c7d8d40e857df1df9a80db55e207d
12 changes: 6 additions & 6 deletions reference/forms/types/collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ the empty values will be kept.

.. caution::

The ``delete_empty`` option will only remove items when the normalized
value is null. If your `type`_ is a compound form type, you need to have
the ``required`` option set to false or ``empty_data`` option explicitly
set to null, both these options can be set inside `options`_. To
understand why this is necessary, see form
:ref:`empty_data <reference-form-option-empty-data>`.
The ``delete_empty`` option only removes items when the normalized value is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are two spaces before "value"

``null``. If your `type`_ is a compound form type, you must either set the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we should be even more explicit it here, before 2.8 options may be confusing, let's use:

If the nested `type`_ is a compound form type

WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 sounds good to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually type must be renamed entry_type in 2.8 too.

``required`` option to ``false`` or set the ``empty_data`` option to ``null``.
Both of these options can be set inside `options`_. See
:ref:`form's empty_data option <reference-form-option-empty-data>` to learn
why this is necessary.

options
~~~~~~~
Expand Down