When deleting a grid field with my field type in it, the function $this->content_id()
in ft.fieldtype.php
returns a 0
rather than the entry ID of the entry. Without the entry ID, I cannot get enough context to safely delete rows from my table for that grid field since all I get is the grid_row_id in the array. Can the field type method content_id()
return the entry ID?
Ah ok I think I see where we’re explicitly setting that to zero. Kind of nervous to fix that in a 3.x release, maybe someone is relying on it to be zero to tell if we’re in a deleting state or something weird (we’ve seen it all). You should have the information you need to triangulate though. You should be able to grab the grid_field_id
from the settings array, then query the channel_grid_field_x
table for the row IDs you were passed to grid_delete
to get the associated entry ID. It’s not great, but should get the job done and be a fairly inexpensive operation. Is that doable? In the mean time, I’ll see if I can get this fixed in our 4.0 branch.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.