From: SourceForge.net <no...@so...> - 2009-11-14 23:06:40
|
Bugs item #2897816, was opened at 2009-11-14 22:43 Message generated for change (Comment added) made by liedekef You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=2897816&group_id=8956 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Admin Group: 2.1.3 >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Arjen van Bochoven (bochoven) Assigned to: Nobody/Anonymous (nobody) Summary: Copying an existing survey does not copy conditions Initial Comment: I would like to reopen SFID 2669428, but I can't seem to find a way to do that. The sql statement in survey_aggregate.inc on line 152 to 165 contains hardcoded tablenames which will fail when used together with prefixed tables: // copy conditions $sql =<<<EOSQL INSERT INTO conditions (id, survey_id, q1_id, q2_id, cond, cond_value) SELECT NULL, $new_sid, qnew1.id, qnew2.id, cond, cond_value FROM question qold1, question qold2, question qnew1, question qnew2, conditions c WHERE qold1.id=c.q1_id AND qold2.id=c.q2_id AND qold1.survey_id=$sid AND qold2.survey_id=$sid AND qnew1.survey_id=$new_sid AND qnew1.position=qold1.position AND qnew1.deleted=qold1.deleted AND qnew2.survey_id=$new_sid AND qnew2.position=qold2.position AND qnew2.deleted=qold2.deleted EOSQL; Arjen ---------------------------------------------------------------------- Comment By: Franky Van Liedekerke (liedekef) Date: 2009-11-15 00:06 Message: The latest development code contains the fix, please update to the development code or wait for an official release. ---------------------------------------------------------------------- Comment By: Arjen van Bochoven (bochoven) Date: 2009-11-14 23:07 Message: My proposed fix: // copy conditions $sql = " INSERT INTO ".$GLOBALS['ESPCONFIG']['condition_table']." (id, survey_id, q1_id, q2_id, cond, cond_value) SELECT NULL, $new_sid, qnew1.id, qnew2.id, cond, cond_value FROM ".$GLOBALS['ESPCONFIG']['question_table']." qold1, ".$GLOBALS['ESPCONFIG']['question_table']." qold2, ".$GLOBALS['ESPCONFIG']['question_table']." qnew1, ".$GLOBALS['ESPCONFIG']['question_table']." qnew2, ".$GLOBALS['ESPCONFIG']['condition_table']." c WHERE qold1.id=c.q1_id AND qold2.id=c.q2_id AND qold1.survey_id=$sid AND qold2.survey_id=$sid AND qnew1.survey_id=$new_sid AND qnew1.position=qold1.position AND qnew1.deleted=qold1.deleted AND qnew2.survey_id=$new_sid AND qnew2.position=qold2.position AND qnew2.deleted=qold2.deleted "; Arjen ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=2897816&group_id=8956 |