./admin/Public/form_data/FG_var_card.inc
Code:
@line 952 (approx)
change to this:
$HD_Form -> AddEditElement (gettext("CUSTOMER HISTORY"),
"description",
'$value',
"HAS_MANY",
"multiline",
"",
"",
"",
"",
"",
"", "", "", "", "", "cc_card_history:description:description,id_cc_card,datecreated,***id***:id_cc_card = %id::id_cc_card::2:::::0");
// basically add id at the end of retrieved fields. you will use this ID later to delete based on it (no asteriscs of course)
in ./common/lib/Form/Class.FormHandler.EditForm.inc.php
Code:
@line 593 (approx)
change $split_select_list[$j][0] to $split_select_list[$j][3]
// these are indexes of the fields retrieved. if you parse retrieved fields by comma you get
// 0 - description
// 1 - id_cc_card
// 2 - date_created
// 3 - id (the one we added in FG_var_card.inc)
in ./common/lib/Form/Class.FormHandler.inc.php
Code:
@line 1865 (approx). immedately after $SPLIT_FG_DELETE_CLAUSE = ...; and before $instance_sub_table -> ...;
// insert this code
if($this->FG_TABLE_EDITION[$sub_action][0] == 'CUSTOMER HISTORY'){
$SPLIT_FG_DELETE_CLAUSE = "id='".$value."'";
}
// what this does is it checks if we are deleting customer history entry and if so then we replace the delete clause with a simpler one because we know value is an id
tested and used in production by me