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

Conversation

murilolobato
Copy link
Contributor

No description provided.

…try to activate delete_empty

for collections of compound forms.
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

Thanks for opening that PR!


Delete empty will only remove items when the normalized value is null.
If your `type`_ is a compound form type, you need to have the :ref:`required <reference-form-option-required>`
option set to ``false`` inside `options`_, See :ref:`empty_data <reference-form-option-empty-data>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add:

or ``empty_data`` option explicitly set to null.

Copy link
Contributor

Choose a reason for hiding this comment

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

We could also mention that the required or empty_data options can be defined as entry_options of the CollectionType, not necessarily in the nested type class itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the above text, when I mean 'options' I'm referring to 'entry_options', it is because I'm making the pull request to syfmony 2.7.

@@ -268,6 +268,13 @@ delete_empty

**type**: ``Boolean`` **default**: ``false``

.. caution::
Copy link
Contributor

Choose a reason for hiding this comment

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

The block should be added after the description.

@@ -268,6 +268,13 @@ delete_empty

**type**: ``Boolean`` **default**: ``false``

.. caution::

Delete empty will only remove items when the normalized value is null.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would either say:

The ``delete_empty`` option will...

or "This option will ...".


Delete empty will only remove items when the normalized value is null.
If your `type`_ is a compound form type, you need to have the :ref:`required <reference-form-option-required>`
option set to ``false`` inside `options`_, See :ref:`empty_data <reference-form-option-empty-data>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

"inside options" could be removed, but let's wait for other reviewers opinion before rewording it.

@HeahDude HeahDude added the Form label Apr 7, 2017
@HeahDude HeahDude added this to the 2.7 milestone Apr 7, 2017
@@ -273,6 +273,15 @@ form you have to set this option to true. However, existing collection entries
will only be deleted if you have the allow_delete_ option enabled. Otherwise
the empty values will be kept.

.. caution::

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"

Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

Note to merger options must be renamed entry_options when merged in 2.8.

.. caution::

The ``delete_empty`` option only removes items when the normalized value is
``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.

@xabbuh
Copy link
Member

xabbuh commented Jul 21, 2017

Thank you @murilolobato.

@xabbuh xabbuh merged commit ce30e47 into symfony:2.7 Jul 21, 2017
xabbuh added a commit that referenced this pull request Jul 21, 2017
…per when he try to activate delete_empty for collections of compound forms (murilolobato, javiereguiluz)

This PR was merged into the 2.7 branch.

Discussion
----------

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

Commits
-------

ce30e47 Applied reviewer suggestion
52c0a94 Minor fix
de25ede Minor reword
ca04555 Improved format of message and added missing information.
b9e375c Added caution block under delete_empty to warn the developer when he try to activate delete_empty for collections of compound forms.
xabbuh added a commit that referenced this pull request Jul 21, 2017
xabbuh added a commit that referenced this pull request Jul 21, 2017
* 2.7:
  [#7767] minor rewording
  [#8047] add inline code comment
  Fixed the issue in a different way
  Jquery datePicker syntax update
  [#8104] minor rewording
  Add more precision about automatic provider assignation
  Update data.rst.inc
  Minor reword to explain that path() generates absolute URLs
  Added a caution note about UploadedFile and insulated tests
  Postpone talk about front controllers
  Applied reviewer suggestion
  Minor fix
  Minor reword
  Improved format of message and added missing information.
  Added caution block under delete_empty to warn the developer when he try to activate delete_empty for collections of compound forms.
xabbuh added a commit that referenced this pull request Jul 21, 2017
xabbuh added a commit that referenced this pull request Jul 21, 2017
xabbuh added a commit that referenced this pull request Jul 21, 2017
* 2.7:
  Reworded the article about form login redirects
  Explained the edge-case where the use_referer option doesn't work
  [#7572] fix wording
  [#7585] remove trailing whitespaces
  [#7585] minor rewording
  Fixed a typo
  Fixed a typo
  Update parent_services for tip consistency
  [#7685] use the method role
  Minor change
  Updating doc to specify priority of default normalizer
  [#7767] remove trailing space
  Minor reword
  Moved array validation to the Raw values sub-guide
  Fixed some syntax issues
  missing constraint example from the old readme
  Update console dialog helper documentation
  Improved the advantages/drawbacks of "controllers as services"
xabbuh added a commit that referenced this pull request Jul 21, 2017
* 2.8: (37 commits)
  [#8192] use path() in PHP templates
  Reworded the article about form login redirects
  Explained the edge-case where the use_referer option doesn't work
  [#7572] fix wording
  [#7585] remove trailing whitespaces
  [#7585] minor rewording
  Fixed a typo
  Fixed a typo
  Update parent_services for tip consistency
  [#7685] use the method role
  Minor change
  Updating doc to specify priority of default normalizer
  [#7767] remove trailing space
  [#7767] replace "options" with "entry_options"
  [#7767] minor rewording
  [#8047] add inline code comment
  Fixed the issue in a different way
  Jquery datePicker syntax update
  [#8104] minor rewording
  Add more precision about automatic provider assignation
  ...
xabbuh added a commit that referenced this pull request Jul 21, 2017
* 3.2: (38 commits)
  [#8192] use path() in PHP templates
  Reworded the article about form login redirects
  Explained the edge-case where the use_referer option doesn't work
  [#7572] fix wording
  [#7585] remove trailing whitespaces
  [#7585] minor rewording
  Fixed a typo
  Fixed a typo
  Update parent_services for tip consistency
  [#7685] use the method role
  Minor change
  Updating doc to specify priority of default normalizer
  [#7767] remove trailing space
  [#7767] replace "options" with "entry_options"
  [#7767] minor rewording
  [#8047] add inline code comment
  Fixed the issue in a different way
  Jquery datePicker syntax update
  Fix framework instantiation in event-dispatcher
  [#8104] minor rewording
  ...
xabbuh added a commit that referenced this pull request Jul 21, 2017
* 3.3: (46 commits)
  [#8192] use path() in PHP templates
  Reworded the article about form login redirects
  Update Flex documentation with latest structure
  Explained the edge-case where the use_referer option doesn't work
  [#7572] fix wording
  [#7585] remove trailing whitespaces
  [#7585] minor rewording
  Fixed a typo
  Fixed a typo
  Update parent_services for tip consistency
  [#7685] use the method role
  Minor change
  Updating doc to specify priority of default normalizer
  [#7767] remove trailing space
  [#7767] replace "options" with "entry_options"
  [#7767] minor rewording
  [#8047] add inline code comment
  Fixed the issue in a different way
  Jquery datePicker syntax update
  Fix framework instantiation in event-dispatcher
  ...
xabbuh added a commit that referenced this pull request Jul 21, 2017
* 3.4: (48 commits)
  [#8192] use path() in PHP templates
  Reworded the article about form login redirects
  Update Flex documentation with latest structure
  Explained the edge-case where the use_referer option doesn't work
  [#7572] fix wording
  [#7585] remove trailing whitespaces
  [#7585] minor rewording
  Fixed a typo
  Fixed a typo
  Update parent_services for tip consistency
  [#7685] use the method role
  Minor change
  Updating doc to specify priority of default normalizer
  [#7767] remove trailing space
  [#7767] replace "options" with "entry_options"
  [#7767] minor rewording
  [#8047] add inline code comment
  Fixed the issue in a different way
  Jquery datePicker syntax update
  Fix framework instantiation in event-dispatcher
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants