Bug #20718 Version Retired

Cannot delete all rows from Grid field in Channel Forms

Version: 2.9.2 Reporter: Quinn Chrzan

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

When deleting all of the rows in a grid field in Channel Forms all of the grid input fields get removed from the form. Upon submit there is no POST value for the grid field so Channel_form_lib doesn’t call out to the Grid field type and the rows never get deleted. You can replicate with this template:

{exp:channel:form channel="news" return="news/{segment_2}" entry_id="{segment_2}"}
 {field:grid_field}
 <input type="submit" name="submit" value="Submit">
{/exp:channel:form}
  • Add the following line to the beginning of system/expressionengine/fieldtypes/grid/views/publish.php:

    <code><input type="hidden" name="<?=$field_id?>" value="placeholder"/></code>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases