# HG changeset patch # User Michiel Broek # Date 1632559374 -7200 # Node ID e64fd38c469cd5bf091e6af4f726c99608530528 # Parent daf55c944fb0c6208bad52ba5dffa9f857a082ca If during styles import the CATEGORY_NUMBER is empty, insert 0 in the database instead. diff -r daf55c944fb0 -r e64fd38c469c www/upl_styles.php --- a/www/upl_styles.php Sun Sep 12 20:35:04 2021 +0200 +++ b/www/upl_styles.php Sat Sep 25 10:42:54 2021 +0200 @@ -56,8 +56,12 @@ $sql .= "', notes='" . mysqli_real_escape_string($db, $style->NOTES); if ($style->CATEGORY) $sql .= "', category='" . mysqli_real_escape_string($db, $style->CATEGORY); - if ($style->CATEGORY_NUMBER) - $sql .= "', category_number='" . $style->CATEGORY_NUMBER; + if ($style->CATEGORY_NUMBER) { + if (strlen($style->CATEGORY_NUMBER)) + $sql .= "', category_number='" . $style->CATEGORY_NUMBER; + else + $sql .= "', category_number='0"; + } if ($style->STYLE_LETTER) $sql .= "', style_letter='" . mysqli_real_escape_string($db, $style->STYLE_LETTER); if ($style->STYLE_GUIDE)