From 035cae656f185961e9b8600429b27bc6fa70a8c3 Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Fri, 19 May 2017 22:14:34 +0200 Subject: [PATCH] Fix bug in insert method Missing the last comma in the insert method --- dev/skeletons/build_class_from_table.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/skeletons/build_class_from_table.php b/dev/skeletons/build_class_from_table.php index 62ad1188759..537975365ef 100755 --- a/dev/skeletons/build_class_from_table.php +++ b/dev/skeletons/build_class_from_table.php @@ -251,7 +251,7 @@ $cleanparam=''; $i=0; foreach($property as $key => $prop) { - $i++; + $addfield=1; if ($prop['field'] == 'tms') $addfield=0; // This is a field of type timestamp edited automatically if ($prop['extra'] == 'auto_increment') $addfield=0; @@ -263,6 +263,7 @@ foreach($property as $key => $prop) $varprop.="';"; $varprop.="\n"; } + $i++; } $targetcontent=preg_replace('/\$sql \.= \' field1,\';/', $varprop, $targetcontent); $targetcontent=preg_replace('/\$sql \.= \' field2\';/', '', $targetcontent);