Fix #1267 List is not renumbered after delete & Fix #1264 Can not add field, if there is no field in database

This commit is contained in:
Nicolas Le Goff
2013-07-10 19:24:19 +02:00
parent 14949cb619
commit 68ebcfddb5
8 changed files with 73 additions and 50 deletions

View File

@@ -970,8 +970,9 @@ class databox_field implements cache_cacheableInterface
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
if ($row)
$sorter = (int) $row['sorter'];
if ($row) {
$sorter = max(1, (int) $row['sorter']);
}
$sql = "INSERT INTO metadatas_structure
(`id`, `name`, `src`, `readonly`, `indexable`, `type`, `tbranch`,