Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#15 Page break insert results in an update on all surveys +patch

open-works-for-me
nobody
9
2007-01-09
2007-01-09
tned
No

Due to a bug in the mssql update statement to insert a pagebreak in a survey the other surveys also get an update. if the inserted page from every survey is the same and the OID is higer then the point where the page break is inserted, the questions from that page are pushed to the next page. and can be found on strange spots on the next page due to irregularities in the OID numbering.

patch

*** editsurvey.class.php Mon Nov 8 06:34:22 2004
--- editsurvey.class.php Mon Jan 8 18:29:11 2007
***************
*** 1175,1181 ****
else
{
$query = "UPDATE {$this->CONF['db_tbl_prefix']}questions SET page = page + 1 WHERE sid = $sid AND
! (page > $page) OR (page = $page AND oid > $oid)";
$rs = $this->db->Execute($query);
if($rs === FALSE)
{ $error[] = 'Cannot insert page break: ' . $this->db->ErrorMsg(); }
--- 1175,1181 ----
else
{
$query = "UPDATE {$this->CONF['db_tbl_prefix']}questions SET page = page + 1 WHERE sid = $sid AND
! ((page > $page) OR (page = $page AND oid > $oid))";
$rs = $this->db->Execute($query);
if($rs === FALSE)
{ $error[] = 'Cannot insert page break: ' . $this->db->ErrorMsg(); }
***************

Discussion

  • tned
    tned
    2007-01-09

    • priority: 5 --> 9
    • status: open --> open-works-for-me
     
  • tned
    tned
    2007-01-09

    Logged In: YES
    user_id=1687241
    Originator: YES

    maybe now it shows better.

    *** classes/editsurvey.class.php Mon Nov 8 06:34:22 2004
    --- classes/editsurvey.class.php Mon Jan 8 18:29:11 2007
    ***************
    *** 1175,1181 ****
    else
    {
    $query = "UPDATE {$this->CONF['db_tbl_prefix']}questions SET page = page + 1 WHERE sid = $sid AND
    ! (page > $page) OR (page = $page AND oid > $oid)";
    $rs = $this->db->Execute($query);
    if($rs === FALSE)
    { $error[] = 'Cannot insert page break: ' . $this->db->ErrorMsg(); }
    --- 1175,1181 ----
    else
    {
    $query = "UPDATE {$this->CONF['db_tbl_prefix']}questions SET page = page + 1 WHERE sid = $sid AND
    ! ((page > $page) OR (page = $page AND oid > $oid))";
    $rs = $this->db->Execute($query);
    if($rs === FALSE)
    { $error[] = 'Cannot insert page break: ' . $this->db->ErrorMsg(); }

     
  • tned
    tned
    2007-01-09

    Logged In: YES
    user_id=1687241
    Originator: YES

    Seems to be in CVS