Error handling in embedded_list
I'm using embedded_lists extensively to handle related items in a model and I need to check certain conditions before allowing a related item to be deleted. I can put the checks into on_before_delete methods in the related models and use add_error to add a message to the user to inform them why the delete action was not permitted. However, as far as I can see, the error collection does not get displayed to the user as a result of an inline_delete. So, the user's experience is that they attempt to delete something, and it doesn't delete and there's no explanation for it.
Is there a better way you can suggest of handling this?
Thanks
Comments
public function get_embedded_list_items($params, $list_cols = array(), $actions = array('edit')) { $table = ''; if (has_errors()) { $table .= display_errors().$table; } $table .= parent::get_embedded_list_items($params, $list_cols, $actions); return $table; }