Cannot delete all rows from Grid field in Channel Forms using {display_fields} tag

However, it affects the {display_fields} tag rather than the {field:field_name} tag.

When using {display_fields} within the {custom_fields} tag pair, you cannot delete the last remaining row of a grid field. The field display is removed when the delete icon is pressed, and is replaced by the notice to add a row. But when saved, the field does not pass an empty array for the field/row value to the ee()->grid_lib->save() method and therefore the row is not deleted from the database.

Here’s the code (as per the documentation https://docs.expressionengine.com/latest/channel/channel_form/index.html#id71):

{custom_fields}{display_field}{/custom_fields}

I can confirm that {field:field_name} tag works as it should, and you are able to delete the last remaining row.

Correction - cannot get it working with {field:field_name}. I’m using the following workaround:

Username

Password

Email Address

Used to log in

Display Name

Password

By registering, you agree to our terms of service, including receiving some tips and offers from us from time to time. We never spam, and we never share your email address with third parties. Terms of ServicePrivacy Policy