Navigation Menu

Skip to content

Commit

Permalink
changed pictures.seq initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Mar 20, 2016
1 parent da2272f commit 0a01556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion htdocs/doc/sql/stored-proc/maintain-current.inc.php
Expand Up @@ -1503,7 +1503,9 @@
IF ISNULL(@XMLSYNC) OR @XMLSYNC!=1 THEN
SET NEW.`date_created`=NOW();
SET NEW.`last_modified`=NOW();
SET NEW.`seq`= IFNULL((SELECT MAX(`seq`)+1 FROM `pictures` WHERE `object_type`=NEW.`object_type` AND `object_id`=NEW.`object_id`), 1);
IF NEW.`seq` = 0 THEN
SET NEW.`seq` = IFNULL((SELECT MAX(`seq`)+1 FROM `pictures` WHERE `object_type`=NEW.`object_type` AND `object_id`=NEW.`object_id`), 1);
END IF;
END IF;
IF ISNULL(NEW.`uuid`) OR NEW.`uuid`='' THEN
Expand Down
2 changes: 1 addition & 1 deletion htdocs/lib2/logic/picture.class.php
Expand Up @@ -55,7 +55,7 @@ function __construct($nNewPictureId=ID_NEW)
$this->rePicture->addInt('unknown_format', 0, false);
$this->rePicture->addInt('display', 1, false);
$this->rePicture->addInt('mappreview', 0, false);
$this->rePicture->addInt('seq', 1, false);
$this->rePicture->addInt('seq', 0, false);

$this->nPictureId = $nNewPictureId+0;

Expand Down

0 comments on commit 0a01556

Please sign in to comment.