View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18172Bug reportsImport/Exportpublic2022-10-10 10:47
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version5.3.x 
Summary18172: MSSQL issue when import from old responses DB
Description

With MSSQL , when import form old database with preserve id : receive error

Steps To Reproduce

Steps to reproduce

get a MSSQL server
Create a survey
Activate
Fill some response
Deactivate
Activate
Go to Reponse/import from old response
Check preserveIDS
Import button

Expected result

Old response was imported with ID

Actual result

SQL error "Cannot insert explicit value for identity column in table 'lime_survey_XXXX'"

TagsNo tags attached.
Attached Files
CDbException.html (32,192 bytes)   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CDbException</title>

<style type="text/css">
/*<![CDATA[*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
body{line-height:1;}
ol,ul{list-style:none;}
blockquote,q{quotes:none;}
blockquote:before,blockquote:after,q:before,q:after{content:none;}
:focus{outline:0;}
ins{text-decoration:none;}
del{text-decoration:line-through;}
table{border-collapse:collapse;border-spacing:0;}

body {
	font: normal 9pt "Verdana";
	color: #000;
	background: #fff;
}

h1 {
	font: normal 18pt "Verdana";
	color: #f00;
	margin-bottom: .5em;
}

h2 {
	font: normal 14pt "Verdana";
	color: #800000;
	margin-bottom: .5em;
}

h3 {
	font: bold 11pt "Verdana";
}

pre {
	font: normal 11pt Menlo, Consolas, "Lucida Console", Monospace;
}

pre span.error {
	display: block;
	background: #fce3e3;
}

pre span.ln {
	color: #999;
	padding-right: 0.5em;
	border-right: 1px solid #ccc;
}

pre span.error-ln {
	font-weight: bold;
}

.container {
	margin: 1em 4em;
}

.version {
	color: gray;
	font-size: 8pt;
	border-top: 1px solid #aaa;
	padding-top: 1em;
	margin-bottom: 1em;
}

.message {
	color: #000;
	padding: 1em;
	font-size: 11pt;
	background: #f3f3f3;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	margin-bottom: 1em;
	line-height: 160%;
}

.source {
	margin-bottom: 1em;
}

.code pre {
	background-color: #ffe;
	margin: 0.5em 0;
	padding: 0.5em;
	line-height: 125%;
	border: 1px solid #eee;
}

.source .file {
	margin-bottom: 1em;
	font-weight: bold;
}

.traces {
	margin: 2em 0;
}

.trace {
	margin: 0.5em 0;
	padding: 0.5em;
}

.trace.app {
	border: 1px dashed #c00;
}

.trace .number {
	text-align: right;
	width: 2em;
	padding: 0.5em;
}

.trace .content {
	padding: 0.5em;
}

.trace .plus,
.trace .minus {
	display:inline;
	vertical-align:middle;
	text-align:center;
	border:1px solid #000;
	color:#000;
	font-size:10px;
	line-height:10px;
	margin:0;
	padding:0 1px;
	width:10px;
	height:10px;
}

.trace.collapsed .minus,
.trace.expanded .plus,
.trace.collapsed pre {
	display: none;
}

.trace-file {
	cursor: pointer;
	padding: 0.2em;
}

.trace-file:hover {
	background: #f0ffff;
}
/*]]>*/
</style>
</head>

<body>
<div class="container">
	<h1>CDbException</h1>

	<p class="message">
		CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: 
[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert 
explicit value for identity column in table 'lime_survey_782166' when 
IDENTITY_INSERT is set to OFF.. The SQL statement executed was: INSERT 
INTO [dbo].[lime_survey_782166] ([id], [token], [submitdate], 
[lastpage], [startlanguage], [seed], [startdate], [datestamp], 
[782166X22X548], [782166X22X527], [782166X22X486], [782166X22X490], 
[782166X22X541], [782166X22X487], [782166X22X488], [782166X22X560], 
[782166X22X542], [782166X22X542other], [782166X22X489MACRO], 
[782166X22X489MICRO], [782166X22X489QUAL], [782166X22X489META], 
[782166X22X489METHO], [782166X22X489ALGOR], [782166X22X489NONE], 
[782166X22X497WPAPE], [782166X22X497PUB], [782166X22X497ECONO], 
[782166X22X497VIZ], [782166X22X497PSIMU], [782166X22X497NONE], 
[782166X22X498CATAL], [782166X22X498GLOSS], [782166X22X498SOFTW], 
[782166X22X498TRAIN], [782166X22X498NONE], 
[782166X22X561DATABASES_DESCRIPTION], 
[782166X22X561WPAPERSS_DESCRIPTION], 
[782166X22X561PUBLICATIONS_DESCRIPTION], 
[782166X22X561VISUALISATIONS_DESCRIPTION], 
[782166X22X561POLSIMULATIONS_DESCRIPTION], 
[782166X22X561METHODG_DESCRIPTION], [782166X22X559DATA], 
[782166X22X559WPAP], [782166X22X559PUBL], [782166X22X504], 
[782166X22X553BRA], [782166X22X553CHN], [782166X22X553IND], 
[782166X22X553IDN], [782166X22X553ZAF], [782166X22X553NONE], 
[782166X22X494], [782166X22X518], [782166X22X519], [782166X22X499], 
[782166X22X492NONE], [782166X22X492CFE], [782166X22X492CTP], 
[782166X22X492DAF], [782166X22X492DCD], [782166X22X492DEV], 
[782166X22X492ECO], [782166X22X492EDU], [782166X22X492ELS], 
[782166X22X492ENV], [782166X22X492EXD], [782166X22X492GOV], 
[782166X22X492IEA], [782166X22X492ITF], [782166X22X492NEA], 
[782166X22X492PAC], [782166X22X492SDD], [782166X22X492SGE], 
[782166X22X492SKC], [782166X22X492STI], [782166X22X492SWAC], 
[782166X22X492TAD], [782166X22X492WISE], [782166X22X493NONE], 
[782166X22X493BIS], [782166X22X493ECB], [782166X22X493EC], 
[782166X22X493FAO], [782166X22X493ILO], [782166X22X493IMF], 
[782166X22X493ITU], [782166X22X493ESTAT], [782166X22X493UNCTAD], 
[782166X22X493UNESCAP], [782166X22X493UNESCWA], [782166X22X493UNECA], 
[782166X22X493UNECE], [782166X22X493UNECLAC], [782166X22X493UNESCO], 
[782166X22X493UNHAB], [782166X22X493UNIDO], [782166X22X493UNODC], 
[782166X22X493UNSD], [782166X22X493WB], [782166X22X493WHO], 
[782166X22X493UNWTO], [782166X22X493WTO], [782166X22X493other], 
[782166X22X500], [782166X22X500other], [782166X22X495], 
[782166X22X496ACHIEV], [782166X22X496NOREL], [782166X22X496BUDGET], 
[782166X22X496other], [782166X22X528], [782166X22X547], [782166X23X535],
 [782166X23X501OECD], [782166X23X501INTORG], [782166X23X501NSOs], 
[782166X23X501GOV], [782166X23X501CENBKS], [782166X23X501CHAMB], 
[782166X23X501COMMP], [782166X23X501RESER], [782166X23X501CROWD], 
[782166X23X501GAFA], [782166X23X501other], [782166X23X545OECD], 
[782166X23X545INTORG], [782166X23X545NSOs], [782166X23X545GOV], 
[782166X23X545CENBKS], [782166X23X545CHAMB], [782166X23X545COMMP], 
[782166X23X545RESER], [782166X23X545CROWD], [782166X23X545GAFA], 
[782166X23X545other], [782166X23X558], [782166X23X546PREF], 
[782166X23X546EMPTY], [782166X23X546DOWN], [782166X23X546COPY], 
[782166X23X546other], [782166X23X532], [782166X23X554SQ001_SQ001], 
[782166X23X554SQ001_SQ002], [782166X23X554SQ002_SQ001], 
[782166X23X554SQ002_SQ002], [782166X23X554SQ003_SQ001], 
[782166X23X554SQ003_SQ002], [782166X23X540], [782166X23X540_filecount], 
[782166X23X555], [782166X23X555_filecount], [782166X23X556], 
[782166X23X556_filecount], [782166X23X502SQ006], [782166X23X502SQ002], 
[782166X23X502SQ003], [782166X23X502SQ004], [782166X23X502SQ001], 
[782166X23X502SQ007], [782166X23X502SQ005], [782166X23X502other], 
[782166X23X543TOOL1], [782166X23X543TOOL2], [782166X23X543TOOL3], 
[782166X23X543TOOL4], [782166X23X543TOOL5], [782166X23X543TOOL6], 
[782166X23X543TOOL7], [782166X23X543TOOL8], [782166X23X544], 
[782166X23X549TECH1], [782166X23X549TECH2], [782166X23X549TECH3], 
[782166X23X549TECH4], [782166X23X549TECH5], [782166X23X549TECH6], 
[782166X23X549TECH7], [782166X23X549TECH8], [782166X23X549TECH9], 
[782166X23X549TECH10], [782166X23X549TECH11], [782166X23X549TECH12], 
[782166X23X549TECH13], [782166X23X549TECH14], [782166X23X550], 
[782166X23X551DISS1], [782166X23X551DISS2], [782166X23X551DISS3], 
[782166X23X551DISS4], [782166X23X551DISS5], [782166X23X551DISS6], 
[782166X23X551DISS7], [782166X23X552], [782166X23X503SQ002], 
[782166X23X503SQ003], [782166X23X503SQ004], [782166X23X503SQ008], 
[782166X23X503SQ005], [782166X23X503SQ006], [782166X23X503SQ007], 
[782166X23X503SQ001], [782166X23X503other], [782166X23X525], 
[782166X23X526], [782166X23X538OECDCOLL_YEARS], 
[782166X23X538OECDCOLL_MONTHS], [782166X23X538OECDCOLL_DAYS], 
[782166X23X538OECDDISS_YEARS], [782166X23X538OECDDISS_MONTHS], 
[782166X23X538OECDDISS_DAYS], [782166X23X520], [782166X23X533SQ001], 
[782166X23X533SQ002], [782166X23X533SQ003], [782166X23X533SQ004], 
[782166X23X534SQ001], [782166X23X534SQ002], [782166X23X534SQ003], 
[782166X23X534SQ004], [782166X23X557], [782166X23X521], [782166X23X529],
 [782166X24X536], [782166X24X4911], [782166X24X4912], [782166X24X4913], 
[782166X24X4914], [782166X24X4915], [782166X24X4916], [782166X24X4917], 
[782166X24X4918], [782166X24X4919], [782166X24X49110], 
[782166X24X5221_SQ001], [782166X24X5221_SQ002], [782166X24X5222_SQ001], 
[782166X24X5222_SQ002], [782166X24X5223_SQ001], [782166X24X5223_SQ002], 
[782166X24X5224_SQ001], [782166X24X5224_SQ002], [782166X24X5225_SQ001], 
[782166X24X5225_SQ002], [782166X24X5226_SQ001], [782166X24X5226_SQ002], 
[782166X24X5227_SQ001], [782166X24X5227_SQ002], [782166X24X5228_SQ001], 
[782166X24X5228_SQ002], [782166X24X5229_SQ001], [782166X24X5229_SQ002], 
[782166X24X52210_SQ001], [782166X24X52210_SQ002], [782166X24X524SQ001], 
[782166X24X524SQ002], [782166X24X524SQ003], [782166X24X524SQ004], 
[782166X24X524other], [782166X24X523], [782166X24X505SQ001], 
[782166X24X505SQ002], [782166X24X505SQ003], [782166X24X505SQ004], 
[782166X24X505SQ005], [782166X24X505SQ006], [782166X24X505SQ007], 
[782166X24X506SQ001], [782166X24X506SQ002], [782166X24X506SQ003], 
[782166X24X506SQ004], [782166X24X506SQ005], [782166X24X506SQ006], 
[782166X24X506SQ007], [782166X24X506SQ008], [782166X24X506SQ009], 
[782166X24X507SQ001], [782166X24X507SQ002], [782166X24X507SQ003], 
[782166X24X507SQ004], [782166X24X507SQ005], [782166X24X508SQ001], 
[782166X24X508SQ002], [782166X24X508SQ003], [782166X24X508SQ004], 
[782166X24X509SQ001], [782166X24X509SQ002], [782166X24X509SQ003], 
[782166X24X509SQ004], [782166X24X509SQ005], [782166X24X510SQ001], 
[782166X24X510SQ002], [782166X24X510SQ003], [782166X24X510SQ004], 
[782166X24X510SQ005], [782166X24X516], [782166X24X530], [782166X25X537],
 [782166X25X539SQ001], [782166X25X539SQ002], [782166X25X539SQ003], 
[782166X25X539SQ004], [782166X25X539SQ005], [782166X25X539SQ006], 
[782166X25X539SQ007], [782166X25X511], [782166X25X511other], 
[782166X25X512], [782166X25X513SQ001], [782166X25X513SQ001comment], 
[782166X25X513SQ002], [782166X25X513SQ002comment], [782166X25X513SQ003],
 [782166X25X513SQ003comment], [782166X25X513SQ004], 
[782166X25X513SQ004comment], [782166X25X513SQ005], 
[782166X25X513SQ005comment], [782166X25X513SQ006], 
[782166X25X513SQ006comment], [782166X25X514SQ001], 
[782166X25X514SQ001comment], [782166X25X514SQ002], 
[782166X25X514SQ002comment], [782166X25X514SQ003], 
[782166X25X514SQ003comment], [782166X25X514SQ004], 
[782166X25X514SQ004comment], [782166X25X514SQ005], 
[782166X25X514SQ005comment], [782166X25X515SQ001], [782166X25X515SQ002],
 [782166X25X515SQ003], [782166X25X515SQ004], [782166X25X515SQ005], 
[782166X25X515SQ006], [782166X25X515SQ007], [782166X25X515SQ008], 
[782166X25X515other], [782166X25X517], [782166X25X531]) VALUES (:yp0, 
:yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, 
:yp12, :yp13, :yp14, :yp15, :yp16, :yp17, :yp18, :yp19, :yp20, :yp21, 
:yp22, :yp23, :yp24, :yp25, :yp26, :yp27, :yp28, :yp29, :yp30, :yp31, 
:yp32, :yp33, :yp34, :yp35, :yp36, :yp37, :yp38, :yp39, :yp40, :yp41, 
:yp42, :yp43, :yp44, :yp45, :yp46, :yp47, :yp48, :yp49, :yp50, :yp51, 
:yp52, :yp53, :yp54, :yp55, :yp56, :yp57, :yp58, :yp59, :yp60, :yp61, 
:yp62, :yp63, :yp64, :yp65, :yp66, :yp67, :yp68, :yp69, :yp70, :yp71, 
:yp72, :yp73, :yp74, :yp75, :yp76, :yp77, :yp78, :yp79, :yp80, :yp81, 
:yp82, :yp83, :yp84, :yp85, :yp86, :yp87, :yp88, :yp89, :yp90, :yp91, 
:yp92, :yp93, :yp94, :yp95, :yp96, :yp97, :yp98, :yp99, :yp100, :yp101, 
:yp102, :yp103, :yp104, :yp105, :yp106, :yp107, :yp108, :yp109, :yp110, 
:yp111, :yp112, :yp113, :yp114, :yp115, :yp116, :yp117, :yp118, :yp119, 
:yp120, :yp121, :yp122, :yp123, :yp124, :yp125, :yp126, :yp127, :yp128, 
:yp129, :yp130, :yp131, :yp132, :yp133, :yp134, :yp135, :yp136, :yp137, 
:yp138, :yp139, :yp140, :yp141, :yp142, :yp143, :yp144, :yp145, :yp146, 
:yp147, :yp148, :yp149, :yp150, :yp151, :yp152, :yp153, :yp154, :yp155, 
:yp156, :yp157, :yp158, :yp159, :yp160, :yp161, :yp162, :yp163, :yp164, 
:yp165, :yp166, :yp167, :yp168, :yp169, :yp170, :yp171, :yp172, :yp173, 
:yp174, :yp175, :yp176, :yp177, :yp178, :yp179, :yp180, :yp181, :yp182, 
:yp183, :yp184, :yp185, :yp186, :yp187, :yp188, :yp189, :yp190, :yp191, 
:yp192, :yp193, :yp194, :yp195, :yp196, :yp197, :yp198, :yp199, :yp200, 
:yp201, :yp202, :yp203, :yp204, :yp205, :yp206, :yp207, :yp208, :yp209, 
:yp210, :yp211, :yp212, :yp213, :yp214, :yp215, :yp216, :yp217, :yp218, 
:yp219, :yp220, :yp221, :yp222, :yp223, :yp224, :yp225, :yp226, :yp227, 
:yp228, :yp229, :yp230, :yp231, :yp232, :yp233, :yp234, :yp235, :yp236, 
:yp237, :yp238, :yp239, :yp240, :yp241, :yp242, :yp243, :yp244, :yp245, 
:yp246, :yp247, :yp248, :yp249, :yp250, :yp251, :yp252, :yp253, :yp254, 
:yp255, :yp256, :yp257, :yp258, :yp259, :yp260, :yp261, :yp262, :yp263, 
:yp264, :yp265, :yp266, :yp267, :yp268, :yp269, :yp270, :yp271, :yp272, 
:yp273, :yp274, :yp275, :yp276, :yp277, :yp278, :yp279, :yp280, :yp281, 
:yp282, :yp283, :yp284, :yp285, :yp286, :yp287, :yp288, :yp289, :yp290, 
:yp291, :yp292, :yp293, :yp294, :yp295, :yp296, :yp297, :yp298, :yp299, 
:yp300, :yp301, :yp302, :yp303, :yp304, :yp305, :yp306, :yp307, :yp308, 
:yp309, :yp310, :yp311, :yp312, :yp313, :yp314, :yp315, :yp316, :yp317, 
:yp318, :yp319, :yp320, :yp321, :yp322, :yp323, :yp324, :yp325, :yp326, 
:yp327, :yp328, :yp329, :yp330, :yp331, :yp332, :yp333, :yp334, :yp335, 
:yp336, :yp337, :yp338, :yp339, :yp340, :yp341)	</p>

	<div class="source">
		<p class="file">E:\IIS\website\framework\db\CDbCommand.php(358)</p>
		<div class="code"><pre><span class="ln">346</span>         {
<span class="ln">347</span>             if($this-&gt;_connection-&gt;enableProfiling)
<span class="ln">348</span>                 Yii::endProfile('system.db.CDbCommand.execute('.$this-&gt;getText().$par.')','system.db.CDbCommand.execute');
<span class="ln">349</span> 
<span class="ln">350</span>             $errorInfo=$e instanceof PDOException ? $e-&gt;errorInfo : null;
<span class="ln">351</span>             $message=$e-&gt;getMessage();
<span class="ln">352</span>             Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
<span class="ln">353</span>                 array('{error}'=&gt;$message, '{sql}'=&gt;$this-&gt;getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
<span class="ln">354</span> 
<span class="ln">355</span>             if(YII_DEBUG)
<span class="ln">356</span>                 $message.='. The SQL statement executed was: '.$this-&gt;getText().$par;
<span class="ln">357</span> 
<span class="error"><span class="ln error-ln">358</span>             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
</span><span class="ln">359</span>                 array('{error}'=&gt;$message)),(int)$e-&gt;getCode(),$errorInfo);
<span class="ln">360</span>         }
<span class="ln">361</span>     }
<span class="ln">362</span> 
<span class="ln">363</span>     /**
<span class="ln">364</span>      * Executes the SQL statement and returns query result.
<span class="ln">365</span>      * This method is for executing an SQL query that returns result set.
<span class="ln">366</span>      * @param array $params input parameters (name=&gt;value) for the SQL execution. This is an alternative
<span class="ln">367</span>      * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
<span class="ln">368</span>      * them in this way can improve the performance. Note that if you pass parameters in this way,
<span class="ln">369</span>      * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
<span class="ln">370</span>      * Please also note that all values are treated as strings in this case, if you need them to be handled as
</pre></div>	</div>

	<div class="traces">
		<h2>Stack Trace</h2>
				<table style="width:100%;">
						<tbody><tr class="trace core collapsed">
			<td class="number">
				#0			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\db\ar\CActiveRecord.php(1083): <strong>CDbCommand</strong>-&gt;<strong>execute</strong>()				</div>

				<div class="code"><pre><span class="ln">1078</span>         {
<span class="ln">1079</span>             Yii::trace(get_class($this).'.insert()','system.db.ar.CActiveRecord');
<span class="ln">1080</span>             $builder=$this-&gt;getCommandBuilder();
<span class="ln">1081</span>             $table=$this-&gt;getTableSchema();
<span class="ln">1082</span>             $command=$builder-&gt;createInsertCommand($table,$this-&gt;getAttributes($attributes));
<span class="error"><span class="ln error-ln">1083</span>             if($command-&gt;execute())
</span><span class="ln">1084</span>             {
<span class="ln">1085</span>                 $primaryKey=$table-&gt;primaryKey;
<span class="ln">1086</span>                 if($table-&gt;sequenceName!==null)
<span class="ln">1087</span>                 {
<span class="ln">1088</span>                     if(is_string($primaryKey) &amp;&amp; $this-&gt;$primaryKey===null)
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#1			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\db\ar\CActiveRecord.php(811): <strong>CActiveRecord</strong>-&gt;<strong>insert</strong>(null)				</div>

				<div class="code"><pre><span class="ln">806</span>      * @return boolean whether the saving succeeds
<span class="ln">807</span>      */
<span class="ln">808</span>     public function save($runValidation=true,$attributes=null)
<span class="ln">809</span>     {
<span class="ln">810</span>         if(!$runValidation || $this-&gt;validate($attributes))
<span class="error"><span class="ln error-ln">811</span>             return $this-&gt;getIsNewRecord() ? $this-&gt;insert($attributes) : $this-&gt;update($attributes);
</span><span class="ln">812</span>         else
<span class="ln">813</span>             return false;
<span class="ln">814</span>     }
<span class="ln">815</span> 
<span class="ln">816</span>     /**
</pre></div>			</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#2			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\application\controllers\admin\dataentry.php(375): <strong>CActiveRecord</strong>-&gt;<strong>save</strong>()				</div>

				<div class="code"><pre><span class="ln">370</span>                 $beforeDataEntryImport-&gt;set('iSurveyID', $iSurveyId);
<span class="ln">371</span>                 $beforeDataEntryImport-&gt;set('oModel', $targetResponse);
<span class="ln">372</span>                 App()-&gt;getPluginManager()-&gt;dispatchEvent($beforeDataEntryImport);
<span class="ln">373</span> 
<span class="ln">374</span>                 $imported++;
<span class="error"><span class="ln error-ln">375</span>                 $targetResponse-&gt;save();
</span><span class="ln">376</span>                 $aSRIDConversions[$iOldID] = $targetResponse-&gt;id;
<span class="ln">377</span>                 unset($targetResponse);
<span class="ln">378</span>             }
<span class="ln">379</span> 
<span class="ln">380</span>             Yii::app()-&gt;session['flashmessage'] = sprintf(gT("%s old response(s) were successfully imported."), $imported);
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#3			</td>
			<td class="content">
				<div class="trace-file">
										&nbsp;unknown(0): <strong>DataEntry</strong>-&gt;<strong>import</strong>("782166")				</div>

							</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#4			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\web\actions\CAction.php(115): <strong>ReflectionMethod</strong>-&gt;<strong>invokeArgs</strong>(DataEntry, array("782166"))				</div>

				<div class="code"><pre><span class="ln">110</span>             elseif($param-&gt;isDefaultValueAvailable())
<span class="ln">111</span>                 $ps[]=$param-&gt;getDefaultValue();
<span class="ln">112</span>             else
<span class="ln">113</span>                 return false;
<span class="ln">114</span>         }
<span class="error"><span class="ln error-ln">115</span>         $method-&gt;invokeArgs($object,$ps);
</span><span class="ln">116</span>         return true;
<span class="ln">117</span>     }
<span class="ln">118</span> }
</pre></div>			</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#5			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\application\core\SurveyCommonAction.php(83): <strong>CAction</strong>-&gt;<strong>runWithParamsInternal</strong>(DataEntry,
 ReflectionMethod, array("r" =&gt; 
"admin/dataentry/sa/import/surveyid/782166", "sa" =&gt; "import", 
"surveyid" =&gt; "782166", "iSurveyId" =&gt; "782166", ...))				</div>

				<div class="code"><pre><span class="ln">78</span>             $oMethod = new ReflectionMethod($this, $sDefault);
<span class="ln">79</span>         }
<span class="ln">80</span> 
<span class="ln">81</span>         // We're all good to go, let's execute it
<span class="ln">82</span>         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
<span class="error"><span class="ln error-ln">83</span>         return parent::runWithParamsInternal($this, $oMethod, $params);
</span><span class="ln">84</span>     }
<span class="ln">85</span> 
<span class="ln">86</span>     /**
<span class="ln">87</span>      * Some functions have different parameters, which are just an alias of the
<span class="ln">88</span>      * usual parameters we're getting in the url. This function just populates
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#6			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\web\CController.php(308): <strong>SurveyCommonAction</strong>-&gt;<strong>runWithParams</strong>(array("r"
 =&gt; "admin/dataentry/sa/import/surveyid/782166", "sa" =&gt; "import",
 "surveyid" =&gt; "782166", "iSurveyId" =&gt; "782166", ...))				</div>

				<div class="code"><pre><span class="ln">303</span>     {
<span class="ln">304</span>         $priorAction=$this-&gt;_action;
<span class="ln">305</span>         $this-&gt;_action=$action;
<span class="ln">306</span>         if($this-&gt;beforeAction($action))
<span class="ln">307</span>         {
<span class="error"><span class="ln error-ln">308</span>             if($action-&gt;runWithParams($this-&gt;getActionParams())===false)
</span><span class="ln">309</span>                 $this-&gt;invalidActionParams($action);
<span class="ln">310</span>             else
<span class="ln">311</span>                 $this-&gt;afterAction($action);
<span class="ln">312</span>         }
<span class="ln">313</span>         $this-&gt;_action=$priorAction;
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#7			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\web\CController.php(286): <strong>CController</strong>-&gt;<strong>runAction</strong>(DataEntry)				</div>

				<div class="code"><pre><span class="ln">281</span>      * @see runAction
<span class="ln">282</span>      */
<span class="ln">283</span>     public function runActionWithFilters($action,$filters)
<span class="ln">284</span>     {
<span class="ln">285</span>         if(empty($filters))
<span class="error"><span class="ln error-ln">286</span>             $this-&gt;runAction($action);
</span><span class="ln">287</span>         else
<span class="ln">288</span>         {
<span class="ln">289</span>             $priorAction=$this-&gt;_action;
<span class="ln">290</span>             $this-&gt;_action=$action;
<span class="ln">291</span>             CFilterChain::create($this,$action,$filters)-&gt;run();
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#8			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\web\CController.php(265): <strong>CController</strong>-&gt;<strong>runActionWithFilters</strong>(DataEntry, array())				</div>

				<div class="code"><pre><span class="ln">260</span>         {
<span class="ln">261</span>             if(($parent=$this-&gt;getModule())===null)
<span class="ln">262</span>                 $parent=Yii::app();
<span class="ln">263</span>             if($parent-&gt;beforeControllerAction($this,$action))
<span class="ln">264</span>             {
<span class="error"><span class="ln error-ln">265</span>                 $this-&gt;runActionWithFilters($action,$this-&gt;filters());
</span><span class="ln">266</span>                 $parent-&gt;afterControllerAction($this,$action);
<span class="ln">267</span>             }
<span class="ln">268</span>         }
<span class="ln">269</span>         else
<span class="ln">270</span>             $this-&gt;missingAction($actionID);
</pre></div>			</td>
		</tr>
						<tr class="trace app expanded">
			<td class="number">
				#9			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\application\controllers\AdminController.php(202): <strong>CController</strong>-&gt;<strong>run</strong>("dataentry")				</div>

				<div class="code"><pre><span class="ln">197</span>         }
<span class="ln">198</span> 
<span class="ln">199</span>         $this-&gt;runModuleController($action);
<span class="ln">200</span> 
<span class="ln">201</span> 
<span class="error"><span class="ln error-ln">202</span>         return parent::run($action);
</span><span class="ln">203</span>     }
<span class="ln">204</span> 
<span class="ln">205</span>     /**
<span class="ln">206</span>      * Starting with LS4, 3rd party developper can extends any of the LimeSurve controllers.
<span class="ln">207</span>      *
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#10			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\web\CWebApplication.php(282): <strong>AdminController</strong>-&gt;<strong>run</strong>("dataentry")				</div>

				<div class="code"><pre><span class="ln">277</span>         {
<span class="ln">278</span>             list($controller,$actionID)=$ca;
<span class="ln">279</span>             $oldController=$this-&gt;_controller;
<span class="ln">280</span>             $this-&gt;_controller=$controller;
<span class="ln">281</span>             $controller-&gt;init();
<span class="error"><span class="ln error-ln">282</span>             $controller-&gt;run($actionID);
</span><span class="ln">283</span>             $this-&gt;_controller=$oldController;
<span class="ln">284</span>         }
<span class="ln">285</span>         else
<span class="ln">286</span>             throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
<span class="ln">287</span>                 array('{route}'=&gt;$route===''?$this-&gt;defaultController:$route)));
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#11			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\web\CWebApplication.php(141): <strong>CWebApplication</strong>-&gt;<strong>runController</strong>("admin/dataentry/sa/import/surveyid/782166")				</div>

				<div class="code"><pre><span class="ln">136</span>             foreach(array_splice($this-&gt;catchAllRequest,1) as $name=&gt;$value)
<span class="ln">137</span>                 $_GET[$name]=$value;
<span class="ln">138</span>         }
<span class="ln">139</span>         else
<span class="ln">140</span>             $route=$this-&gt;getUrlManager()-&gt;parseUrl($this-&gt;getRequest());
<span class="error"><span class="ln error-ln">141</span>         $this-&gt;runController($route);
</span><span class="ln">142</span>     }
<span class="ln">143</span> 
<span class="ln">144</span>     /**
<span class="ln">145</span>      * Registers the core application components.
<span class="ln">146</span>      * This method overrides the parent implementation by registering additional core components.
</pre></div>			</td>
		</tr>
						<tr class="trace core collapsed">
			<td class="number">
				#12			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\framework\base\CApplication.php(185): <strong>CWebApplication</strong>-&gt;<strong>processRequest</strong>()				</div>

				<div class="code"><pre><span class="ln">180</span>     public function run()
<span class="ln">181</span>     {
<span class="ln">182</span>         if($this-&gt;hasEventHandler('onBeginRequest'))
<span class="ln">183</span>             $this-&gt;onBeginRequest(new CEvent($this));
<span class="ln">184</span>         register_shutdown_function(array($this,'end'),0,false);
<span class="error"><span class="ln error-ln">185</span>         $this-&gt;processRequest();
</span><span class="ln">186</span>         if($this-&gt;hasEventHandler('onEndRequest'))
<span class="ln">187</span>             $this-&gt;onEndRequest(new CEvent($this));
<span class="ln">188</span>     }
<span class="ln">189</span> 
<span class="ln">190</span>     /**
</pre></div>			</td>
		</tr>
						<tr class="trace app collapsed">
			<td class="number">
				#13			</td>
			<td class="content">
				<div class="trace-file">
											<div class="plus">+</div>
						<div class="minus">–</div>
										&nbsp;E:\IIS\website\index.php(192): <strong>CApplication</strong>-&gt;<strong>run</strong>()				</div>

				<div class="code"><pre><span class="ln">187</span> require_once APPPATH . 'core/LSYii_Application' . EXT;
<span class="ln">188</span> 
<span class="ln">189</span> $config = require_once(APPPATH . 'config/internal' . EXT);
<span class="ln">190</span> 
<span class="ln">191</span> Yii::$enableIncludePath = false;
<span class="error"><span class="ln error-ln">192</span> Yii::createApplication('LSYii_Application', $config)-&gt;run();
</span><span class="ln">193</span> 
<span class="ln">194</span> /* End of file index.php */
<span class="ln">195</span> /* Location: ./index.php */
</pre></div>			</td>
		</tr>
				</tbody></table>
	</div>

	<div class="version">
		2022-05-19 13:21:27 Microsoft-IIS/10.0 <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.24-dev	</div>
</div>

<script type="text/javascript">
/*<![CDATA[*/
var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)");
var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)");

var e = document.getElementsByTagName("div");
for(var j=0,len=e.length;j<len;j++){
	if(traceReg.test(e[j].className)){
		e[j].onclick = function(){
			var trace = this.parentNode.parentNode;
			if(collapsedReg.test(trace.className))
				trace.className = trace.className.replace("collapsed", "expanded");
			else
				trace.className = trace.className.replace("expanded", "collapsed");
		}
	}
}
/*]]>*/
</script>



<div id="grammalecte_menu_main_button_shadow_host" style="width: 0px; height: 0px;"></div></body><script src="CDbException_fichiers/api.js"></script></html>
CDbException.html (32,192 bytes)   
Bug heat4
Complete LimeSurvey version number (& build) 5.3.19
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionmssql sqlsrv
Server OS (if known)windows
Webserver software & version (if known)IIS
PHP Versionphp7.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-06-07 19:33

developer   ~70289

https://github.com/LimeSurvey/LimeSurvey/pull/2460

DenisChenu

DenisChenu

2022-10-05 17:54

developer   ~72127

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=33930

LimeBot

LimeBot

2022-10-10 10:47

administrator   ~72179

Fixed in Release 5.4.5+221010

Related Changesets

LimeSurvey: master 8dcaf653

2022-10-05 17:54:28

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18172: MSSQL issue when import from old responses DB (#2460)

Dev: add needed switchMSSQLIdentityInsert
Affected Issues
18172
mod - application/controllers/admin/DataEntry.php Diff File

Issue History

Date Modified Username Field Change
2022-06-03 10:41 DenisChenu New Issue
2022-06-03 10:41 DenisChenu File Added: CDbException.html
2022-06-06 12:02 DenisChenu Assigned To => DenisChenu
2022-06-06 12:02 DenisChenu Status new => assigned
2022-06-07 19:33 DenisChenu Assigned To DenisChenu =>
2022-06-07 19:33 DenisChenu Status assigned => ready for code review
2022-06-07 19:33 DenisChenu Complete LimeSurvey version number (& build) 5.3.18 => 5.3.19
2022-06-07 19:33 DenisChenu Note Added: 70289
2022-06-07 19:33 DenisChenu Bug heat 0 => 2
2022-10-05 17:54 DenisChenu Changeset attached => LimeSurvey master 8dcaf653
2022-10-05 17:54 DenisChenu Note Added: 72127
2022-10-05 17:54 DenisChenu Assigned To => DenisChenu
2022-10-05 17:54 DenisChenu Resolution open => fixed
2022-10-06 10:40 DenisChenu Status ready for code review => resolved
2022-10-10 10:47 LimeBot Note Added: 72179
2022-10-10 10:47 LimeBot Status resolved => closed
2022-10-10 10:47 LimeBot Bug heat 2 => 4