--- import_functions.php.orig 2011-03-03 16:05:27.801926002 +0100 +++ import_functions.php 2011-03-03 16:34:45.301926002 +0100 @@ -1404,7 +1404,7 @@ $insertdata[(string)$key]=(string)$value; } // replace the qid for the new one (if there is no new qid in the $aQIDReplacements array it mean that this condition is orphan -> error, skip this record) - if (isset($aQIDReplacements[$insertdata['qid']])) + if (isset($aQIDReplacements[$insertdata['qid']]) ) { $insertdata['qid']=$aQIDReplacements[$insertdata['qid']]; // remap the qid } @@ -1412,11 +1412,18 @@ if (isset($aQIDReplacements[$insertdata['cqid']])) { $insertdata['cqid']=$aQIDReplacements[$insertdata['cqid']]; // remap the qid + list($oldcsid, $oldcgid, $oldqidanscode) = explode("X",$insertdata["cfieldname"],3); + } + elseif (strpos($insertdata['cfieldname'], 'TOKEN:ATTRIBUTE_') !== false) // condition is valid but based on token attribute instead of previous question + { + // this is a bit dirty but i don't want to move to much of existing code so i do the sstuff here and then continue + $query=$connect->GetInsertSQL($tablename,$insertdata); + $result=$connect->Execute($query) or safe_die ($clang->gT("Error").": Failed to insert data
\$query
\n".$connect->ErrorMsg()); + $results['conditions']++; + continue; } else continue; // a problem with this answer record -> don't consider - list($oldcsid, $oldcgid, $oldqidanscode) = explode("X",$insertdata["cfieldname"],3); - // replace the gid for the new one in the cfieldname(if there is no new gid in the $aGIDReplacements array it means that this condition is orphan -> error, skip this record) if (!isset($aGIDReplacements[$oldcgid])) continue;