Bug #23181 Bug Fixed

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

Version: 3.5.10 Reporter: seavers

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

This is similar to the bug report in EE2.9.2:

https://expressionengine.com/support/bugs/20718/cannot-delete-all-rows-from-grid-field-in-channel-forms

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.

  • Backup and replace system/ee/EllisLab/Addons/channel/libraries/channel_form/Channel_form_lib.php with the one in the attached zip.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases