View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
13630 | Bug reports | Expression Manager | public | 2018-04-24 12:07 | 2019-04-30 09:13 |
Reporter | DenisChenu | Assigned To | DenisChenu | ||
Priority | none | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 3.7.x | ||||
Fixed in Version | 3.15.x | ||||
Summary | 13630: EM send Notice about Undefined offset | ||||
Description | In some condition : EM send Undefined offset : 1 | ||||
Steps To Reproduce | Import included survey | ||||
Additional Information | The strangest issue : why we don't have this issue before (2.73 have same issue) ? Replace line by if (empty($errs[$errIndex++][1][1])) { send a Array to string conversion at $stringParts[] = "span title='".implode('; ', $messages)."' class='em-error'"; Then $messages are array of array ? | ||||
Tags | No tags attached. | ||||
Attached Files | PHP notice.html (23,306 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>PHP notice</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>PHP notice</h1> <p class="message"> Undefined offset: 1 </p> <div class="source"> <p class="file">/home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_core_helper.php(1299)</p> <div class="code"><pre><span class="ln">1287</span> $errs = $this->RDP_errs; <span class="ln">1288</span> $tokens = $this->RDP_tokens; <span class="ln">1289</span> $errCount = count($errs); <span class="ln">1290</span> $errIndex = 0; <span class="ln">1291</span> if ($errCount > 0) { <span class="ln">1292</span> usort($errs, "cmpErrorTokens"); <span class="ln">1293</span> } <span class="ln">1294</span> $stringParts = array(); <span class="ln">1295</span> $numTokens = count($tokens); <span class="ln">1296</span> $globalErrs = array(); <span class="ln">1297</span> $bHaveError = false; <span class="ln">1298</span> while ($errIndex < $errCount) { <span class="error"><span class="ln error-ln">1299</span> if ($errs[$errIndex++][1][1] == 0) { </span><span class="ln">1300</span> // General message, associated with position 0 <span class="ln">1301</span> $globalErrs[] = $errs[$errIndex - 1][0]; <span class="ln">1302</span> $bHaveError = true; <span class="ln">1303</span> } else { <span class="ln">1304</span> --$errIndex; <span class="ln">1305</span> break; <span class="ln">1306</span> } <span class="ln">1307</span> } <span class="ln">1308</span> for ($i = 0; $i < $numTokens; ++$i) { <span class="ln">1309</span> $token = $tokens[$i]; <span class="ln">1310</span> $messages = array(); <span class="ln">1311</span> $thisTokenHasError = false; </pre></div> </div> <div class="traces"> <h2>Stack Trace</h2> <table style="width:100%;"> <tbody><tr class="trace app expanded"> <td class="number"> #0 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(6918): <strong>ExpressionManager</strong>-><strong>GetPrettyPrintString</strong>() </div> <div class="code"><pre><span class="ln">6913</span> $updatedValues[$sgqa] = $_update; <span class="ln">6914</span> $LEM->updatedValues[$sgqa] = $_update; <span class="ln">6915</span> <span class="ln">6916</span> if (($LEM->debugLevel & LEM_DEBUG_VALIDATION_DETAIL) == LEM_DEBUG_VALIDATION_DETAIL) <span class="ln">6917</span> { <span class="error"><span class="ln error-ln">6918</span> $prettyPrintEqn = $LEM->em->GetPrettyPrintString(); </span><span class="ln">6919</span> $debug_qmessage .= '** Process Hidden but Relevant Equation [' . $sgqa . '](' . $prettyPrintEqn . ') => ' . $result . "<br />\n"; <span class="ln">6920</span> } <span class="ln">6921</span> } <span class="ln">6922</span> <span class="ln">6923</span> // Process Default : 1st part : update in DB if actually relevant and not already set </pre></div> </td> </tr> <tr class="trace app expanded"> <td class="number"> #1 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(5893): <strong>LimeExpressionManager</strong>-><strong>_ValidateQuestion</strong>(3, true) </div> <div class="code"><pre><span class="ln">5888</span> $LEM->maxGroupSeq = $LEM->currentGroupSeq; <span class="ln">5889</span> } <span class="ln">5890</span> <span class="ln">5891</span> $LEM->ProcessAllNeededRelevance($LEM->currentQuestionSeq); <span class="ln">5892</span> $LEM->_CreateSubQLevelRelevanceAndValidationEqns($LEM->currentQuestionSeq); <span class="error"><span class="ln error-ln">5893</span> $result = $LEM->_ValidateQuestion($LEM->currentQuestionSeq,$force); </span><span class="ln">5894</span> $message .= $result['message']; <span class="ln">5895</span> $updatedValues = array_merge($updatedValues,$result['updatedValues']); <span class="ln">5896</span> $gRelInfo = $LEM->gRelInfo[$LEM->currentGroupSeq]; <span class="ln">5897</span> $grel = $gRelInfo['result']; <span class="ln">5898</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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(9370): <strong>LimeExpressionManager</strong>::<strong>JumpTo</strong>(4, true, false, true) </div> <div class="code"><pre><span class="ln">9365</span> if (!is_null($qid)) <span class="ln">9366</span> { <span class="ln">9367</span> $surveyMode='question'; <span class="ln">9368</span> LimeExpressionManager::StartSurvey($sid, 'question', $surveyOptions, false,$LEMdebugLevel); <span class="ln">9369</span> $qseq = LimeExpressionManager::GetQuestionSeq($qid); <span class="error"><span class="ln error-ln">9370</span> $moveResult = LimeExpressionManager::JumpTo($qseq+1,true,false,true); </span><span class="ln">9371</span> } <span class="ln">9372</span> else if (!is_null($gid)) <span class="ln">9373</span> { <span class="ln">9374</span> $surveyMode='group'; <span class="ln">9375</span> LimeExpressionManager::StartSurvey($sid, 'group', $surveyOptions, false,$LEMdebugLevel); </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #3 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/controllers/admin/expressions.php(139): <strong>LimeExpressionManager</strong>::<strong>ShowSurveyLogicFile</strong>("695211", "12", "198", 39, ...) </div> <div class="code"><pre><span class="ln">134</span> <span class="ln">135</span> LimeExpressionManager::SetDirtyFlag(); <span class="ln">136</span> <span class="ln">137</span> Yii::app()->setLanguage(Yii::app()->session['adminlang']); <span class="ln">138</span> <span class="error"><span class="ln error-ln">139</span> $aData['result'] = LimeExpressionManager::ShowSurveyLogicFile($sid, $gid, $qid, $LEMdebugLevel, $assessments); </span><span class="ln">140</span> <span class="ln">141</span> if (Yii::app()->request->getParam('printable', 0) == 1) { <span class="ln">142</span> $html = "<html><body>"; <span class="ln">143</span> $html .= "<style> <span class="ln">144</span> @page { </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #4 </td> <td class="content"> <div class="trace-file"> unknown(0): <strong>Expressions</strong>-><strong>survey_logic_file</strong>() </div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #5 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/actions/CAction.php(109): <strong>ReflectionMethod</strong>-><strong>invokeArgs</strong>(Expressions, array()) </div> <div class="code"><pre><span class="ln">104</span> elseif($param->isDefaultValueAvailable()) <span class="ln">105</span> $ps[]=$param->getDefaultValue(); <span class="ln">106</span> else <span class="ln">107</span> return false; <span class="ln">108</span> } <span class="error"><span class="ln error-ln">109</span> $method->invokeArgs($object,$ps); </span><span class="ln">110</span> return true; <span class="ln">111</span> } <span class="ln">112</span> } </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #6 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/core/Survey_Common_Action.php(83): <strong>CAction</strong>-><strong>runWithParamsInternal</strong>(Expressions, ReflectionMethod, array("sid" => "695211", "gid" => "12", "qid" => "198", "sa" => "survey_logic_file", ...)) </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"> #7 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CController.php(308): <strong>Survey_Common_Action</strong>-><strong>runWithParams</strong>(array("sid" => "695211", "gid" => "12", "qid" => "198", "sa" => "survey_logic_file")) </div> <div class="code"><pre><span class="ln">303</span> { <span class="ln">304</span> $priorAction=$this->_action; <span class="ln">305</span> $this->_action=$action; <span class="ln">306</span> if($this->beforeAction($action)) <span class="ln">307</span> { <span class="error"><span class="ln error-ln">308</span> if($action->runWithParams($this->getActionParams())===false) </span><span class="ln">309</span> $this->invalidActionParams($action); <span class="ln">310</span> else <span class="ln">311</span> $this->afterAction($action); <span class="ln">312</span> } <span class="ln">313</span> $this->_action=$priorAction; </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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CController.php(286): <strong>CController</strong>-><strong>runAction</strong>(Expressions) </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->runAction($action); </span><span class="ln">287</span> else <span class="ln">288</span> { <span class="ln">289</span> $priorAction=$this->_action; <span class="ln">290</span> $this->_action=$action; <span class="ln">291</span> CFilterChain::create($this,$action,$filters)->run(); </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #9 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CController.php(265): <strong>CController</strong>-><strong>runActionWithFilters</strong>(Expressions, array()) </div> <div class="code"><pre><span class="ln">260</span> { <span class="ln">261</span> if(($parent=$this->getModule())===null) <span class="ln">262</span> $parent=Yii::app(); <span class="ln">263</span> if($parent->beforeControllerAction($this,$action)) <span class="ln">264</span> { <span class="error"><span class="ln error-ln">265</span> $this->runActionWithFilters($action,$this->filters()); </span><span class="ln">266</span> $parent->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->missingAction($actionID); </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #10 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/controllers/AdminController.php(158): <strong>CController</strong>-><strong>run</strong>("expressions") </div> <div class="code"><pre><span class="ln">153</span> $this->redirect(array('/admin/authentication/sa/login')); <span class="ln">154</span> } <span class="ln">155</span> } <span class="ln">156</span> } <span class="ln">157</span> <span class="error"><span class="ln error-ln">158</span> return parent::run($action); </span><span class="ln">159</span> } <span class="ln">160</span> <span class="ln">161</span> /** <span class="ln">162</span> * Routes all the actions to their respective places <span class="ln">163</span> * </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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CWebApplication.php(282): <strong>AdminController</strong>-><strong>run</strong>("expressions") </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->_controller; <span class="ln">280</span> $this->_controller=$controller; <span class="ln">281</span> $controller->init(); <span class="error"><span class="ln error-ln">282</span> $controller->run($actionID); </span><span class="ln">283</span> $this->_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}'=>$route===''?$this->defaultController:$route))); </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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CWebApplication.php(141): <strong>CWebApplication</strong>-><strong>runController</strong>("admin/expressions/sa/survey_logic_file") </div> <div class="code"><pre><span class="ln">136</span> foreach(array_splice($this->catchAllRequest,1) as $name=>$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->getUrlManager()->parseUrl($this->getRequest()); <span class="error"><span class="ln error-ln">141</span> $this->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"> #13 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/base/CApplication.php(185): <strong>CWebApplication</strong>-><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->hasEventHandler('onBeginRequest')) <span class="ln">183</span> $this->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->processRequest(); </span><span class="ln">186</span> if($this->hasEventHandler('onEndRequest')) <span class="ln">187</span> $this->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"> #14 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/index.php(194): <strong>CApplication</strong>-><strong>run</strong>() </div> <div class="code"><pre><span class="ln">189</span> require_once APPPATH . 'core/LSYii_Application' . EXT; <span class="ln">190</span> <span class="ln">191</span> $config = require_once(APPPATH . 'config/internal' . EXT); <span class="ln">192</span> <span class="ln">193</span> Yii::$enableIncludePath = false; <span class="error"><span class="ln error-ln">194</span> Yii::createApplication('LSYii_Application', $config)->run(); </span><span class="ln">195</span> <span class="ln">196</span> /* End of file index.php */ <span class="ln">197</span> /* Location: ./index.php */ </pre></div> </td> </tr> </tbody></table> </div> <div class="version"> 2018-04-24 11:44:18 Apache/2.2.22 (Debian) <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.18 </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> </body></html> PHP notice_survey.html (26,017 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>PHP notice</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>PHP notice</h1> <p class="message"> Undefined offset: 1 </p> <div class="source"> <p class="file">/home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_core_helper.php(1299)</p> <div class="code"><pre><span class="ln">1287</span> $errs = $this->RDP_errs; <span class="ln">1288</span> $tokens = $this->RDP_tokens; <span class="ln">1289</span> $errCount = count($errs); <span class="ln">1290</span> $errIndex = 0; <span class="ln">1291</span> if ($errCount > 0) { <span class="ln">1292</span> usort($errs, "cmpErrorTokens"); <span class="ln">1293</span> } <span class="ln">1294</span> $stringParts = array(); <span class="ln">1295</span> $numTokens = count($tokens); <span class="ln">1296</span> $globalErrs = array(); <span class="ln">1297</span> $bHaveError = false; <span class="ln">1298</span> while ($errIndex < $errCount) { <span class="error"><span class="ln error-ln">1299</span> if ($errs[$errIndex++][1][1] == 0) { </span><span class="ln">1300</span> // General message, associated with position 0 <span class="ln">1301</span> $globalErrs[] = $errs[$errIndex - 1][0]; <span class="ln">1302</span> $bHaveError = true; <span class="ln">1303</span> } else { <span class="ln">1304</span> --$errIndex; <span class="ln">1305</span> break; <span class="ln">1306</span> } <span class="ln">1307</span> } <span class="ln">1308</span> for ($i = 0; $i < $numTokens; ++$i) { <span class="ln">1309</span> $token = $tokens[$i]; <span class="ln">1310</span> $messages = array(); <span class="ln">1311</span> $thisTokenHasError = false; </pre></div> </div> <div class="traces"> <h2>Stack Trace</h2> <table style="width:100%;"> <tbody><tr class="trace app expanded"> <td class="number"> #0 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(6918): <strong>ExpressionManager</strong>-><strong>GetPrettyPrintString</strong>() </div> <div class="code"><pre><span class="ln">6913</span> $updatedValues[$sgqa] = $_update; <span class="ln">6914</span> $LEM->updatedValues[$sgqa] = $_update; <span class="ln">6915</span> <span class="ln">6916</span> if (($LEM->debugLevel & LEM_DEBUG_VALIDATION_DETAIL) == LEM_DEBUG_VALIDATION_DETAIL) <span class="ln">6917</span> { <span class="error"><span class="ln error-ln">6918</span> $prettyPrintEqn = $LEM->em->GetPrettyPrintString(); </span><span class="ln">6919</span> $debug_qmessage .= '** Process Hidden but Relevant Equation [' . $sgqa . '](' . $prettyPrintEqn . ') => ' . $result . "<br />\n"; <span class="ln">6920</span> } <span class="ln">6921</span> } <span class="ln">6922</span> <span class="ln">6923</span> // Process Default : 1st part : update in DB if actually relevant and not already set </pre></div> </td> </tr> <tr class="trace app expanded"> <td class="number"> #1 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(6050): <strong>LimeExpressionManager</strong>-><strong>_ValidateQuestion</strong>(3, false) </div> <div class="code"><pre><span class="ln">6045</span> ///////////////////////////////////////////////////////// <span class="ln">6046</span> // CHECK EACH QUESTION, AND SET GROUP-LEVEL PROPERTIES // <span class="ln">6047</span> ///////////////////////////////////////////////////////// <span class="ln">6048</span> for ($i=$groupSeqInfo['qstart'];$i<=$groupSeqInfo['qend']; ++$i) <span class="ln">6049</span> { <span class="error"><span class="ln error-ln">6050</span> $qStatus = $LEM->_ValidateQuestion($i,$force); </span><span class="ln">6051</span> <span class="ln">6052</span> $updatedValues = array_merge($updatedValues,$qStatus['updatedValues']); <span class="ln">6053</span> <span class="ln">6054</span> if ($gRelInfo['result']==true && $qStatus['relevant']==true) { <span class="ln">6055</span> $grel = $gRelInfo['result']; // true; // at least one question relevant </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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(5958): <strong>LimeExpressionManager</strong>-><strong>_ValidateGroup</strong>(0, false) </div> <div class="code"><pre><span class="ln">5953</span> /////////////////////////////////////////////////////// <span class="ln">5954</span> // CHECK EACH GROUP, AND SET SURVEY-LEVEL PROPERTIES // <span class="ln">5955</span> /////////////////////////////////////////////////////// <span class="ln">5956</span> for ($i=0;$i<$LEM->numGroups;++$i) { <span class="ln">5957</span> $LEM->currentGroupSeq=$i; <span class="error"><span class="ln error-ln">5958</span> $gStatus = $LEM->_ValidateGroup($i,$force); </span><span class="ln">5959</span> if (is_null($gStatus)) { <span class="ln">5960</span> continue; // invalid group, so skip it <span class="ln">5961</span> } <span class="ln">5962</span> $message .= $gStatus['message']; <span class="ln">5963</span> </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #3 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(5222): <strong>LimeExpressionManager</strong>-><strong>_ValidateSurvey</strong>() </div> <div class="code"><pre><span class="ln">5217</span> $startingGroup = $LEM->currentGroupSeq; <span class="ln">5218</span> $LEM->StartProcessingPage(true); <span class="ln">5219</span> $updatedValues=$LEM->ProcessCurrentResponses(); <span class="ln">5220</span> $message = ''; <span class="ln">5221</span> $LEM->currentQset = array(); // reset active list of questions <span class="error"><span class="ln error-ln">5222</span> $result = $LEM->_ValidateSurvey(); </span><span class="ln">5223</span> $message .= $result['message']; <span class="ln">5224</span> if (!$force && !is_null($result) && ($result['mandViolation'] || !$result['valid'] || $startingGroup == -1)) { <span class="ln">5225</span> $finished=false; <span class="ln">5226</span> } <span class="ln">5227</span> else </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #4 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/helpers/expressions/em_manager_helper.php(9383): <strong>LimeExpressionManager</strong>::<strong>NavigateForwards</strong>() </div> <div class="code"><pre><span class="ln">9378</span> } <span class="ln">9379</span> else <span class="ln">9380</span> { <span class="ln">9381</span> $surveyMode='survey'; <span class="ln">9382</span> LimeExpressionManager::StartSurvey($sid, 'survey', $surveyOptions, false,$LEMdebugLevel); <span class="error"><span class="ln error-ln">9383</span> $moveResult = LimeExpressionManager::NavigateForwards(); </span><span class="ln">9384</span> } <span class="ln">9385</span> <span class="ln">9386</span> $qtypes=getQuestionTypeList('','array'); <span class="ln">9387</span> <span class="ln">9388</span> if (is_null($moveResult) || is_null($LEM->currentQset) || count($LEM->currentQset) == 0) { </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #5 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/controllers/admin/expressions.php(139): <strong>LimeExpressionManager</strong>::<strong>ShowSurveyLogicFile</strong>("695211", null, null, 39, ...) </div> <div class="code"><pre><span class="ln">134</span> <span class="ln">135</span> LimeExpressionManager::SetDirtyFlag(); <span class="ln">136</span> <span class="ln">137</span> Yii::app()->setLanguage(Yii::app()->session['adminlang']); <span class="ln">138</span> <span class="error"><span class="ln error-ln">139</span> $aData['result'] = LimeExpressionManager::ShowSurveyLogicFile($sid, $gid, $qid, $LEMdebugLevel, $assessments); </span><span class="ln">140</span> <span class="ln">141</span> if (Yii::app()->request->getParam('printable', 0) == 1) { <span class="ln">142</span> $html = "<html><body>"; <span class="ln">143</span> $html .= "<style> <span class="ln">144</span> @page { </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #6 </td> <td class="content"> <div class="trace-file"> unknown(0): <strong>Expressions</strong>-><strong>survey_logic_file</strong>() </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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/actions/CAction.php(109): <strong>ReflectionMethod</strong>-><strong>invokeArgs</strong>(Expressions, array()) </div> <div class="code"><pre><span class="ln">104</span> elseif($param->isDefaultValueAvailable()) <span class="ln">105</span> $ps[]=$param->getDefaultValue(); <span class="ln">106</span> else <span class="ln">107</span> return false; <span class="ln">108</span> } <span class="error"><span class="ln error-ln">109</span> $method->invokeArgs($object,$ps); </span><span class="ln">110</span> return true; <span class="ln">111</span> } <span class="ln">112</span> } </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #8 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/core/Survey_Common_Action.php(83): <strong>CAction</strong>-><strong>runWithParamsInternal</strong>(Expressions, ReflectionMethod, array("sid" => "695211", "sa" => "survey_logic_file", "iSurveyId" => "695211", "iSurveyID" => "695211", ...)) </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"> #9 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CController.php(308): <strong>Survey_Common_Action</strong>-><strong>runWithParams</strong>(array("sid" => "695211", "sa" => "survey_logic_file")) </div> <div class="code"><pre><span class="ln">303</span> { <span class="ln">304</span> $priorAction=$this->_action; <span class="ln">305</span> $this->_action=$action; <span class="ln">306</span> if($this->beforeAction($action)) <span class="ln">307</span> { <span class="error"><span class="ln error-ln">308</span> if($action->runWithParams($this->getActionParams())===false) </span><span class="ln">309</span> $this->invalidActionParams($action); <span class="ln">310</span> else <span class="ln">311</span> $this->afterAction($action); <span class="ln">312</span> } <span class="ln">313</span> $this->_action=$priorAction; </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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CController.php(286): <strong>CController</strong>-><strong>runAction</strong>(Expressions) </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->runAction($action); </span><span class="ln">287</span> else <span class="ln">288</span> { <span class="ln">289</span> $priorAction=$this->_action; <span class="ln">290</span> $this->_action=$action; <span class="ln">291</span> CFilterChain::create($this,$action,$filters)->run(); </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> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CController.php(265): <strong>CController</strong>-><strong>runActionWithFilters</strong>(Expressions, array()) </div> <div class="code"><pre><span class="ln">260</span> { <span class="ln">261</span> if(($parent=$this->getModule())===null) <span class="ln">262</span> $parent=Yii::app(); <span class="ln">263</span> if($parent->beforeControllerAction($this,$action)) <span class="ln">264</span> { <span class="error"><span class="ln error-ln">265</span> $this->runActionWithFilters($action,$this->filters()); </span><span class="ln">266</span> $parent->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->missingAction($actionID); </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #12 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/application/controllers/AdminController.php(158): <strong>CController</strong>-><strong>run</strong>("expressions") </div> <div class="code"><pre><span class="ln">153</span> $this->redirect(array('/admin/authentication/sa/login')); <span class="ln">154</span> } <span class="ln">155</span> } <span class="ln">156</span> } <span class="ln">157</span> <span class="error"><span class="ln error-ln">158</span> return parent::run($action); </span><span class="ln">159</span> } <span class="ln">160</span> <span class="ln">161</span> /** <span class="ln">162</span> * Routes all the actions to their respective places <span class="ln">163</span> * </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #13 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CWebApplication.php(282): <strong>AdminController</strong>-><strong>run</strong>("expressions") </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->_controller; <span class="ln">280</span> $this->_controller=$controller; <span class="ln">281</span> $controller->init(); <span class="error"><span class="ln error-ln">282</span> $controller->run($actionID); </span><span class="ln">283</span> $this->_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}'=>$route===''?$this->defaultController:$route))); </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #14 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/web/CWebApplication.php(141): <strong>CWebApplication</strong>-><strong>runController</strong>("admin/expressions/sa/survey_logic_file") </div> <div class="code"><pre><span class="ln">136</span> foreach(array_splice($this->catchAllRequest,1) as $name=>$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->getUrlManager()->parseUrl($this->getRequest()); <span class="error"><span class="ln error-ln">141</span> $this->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"> #15 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/framework/base/CApplication.php(185): <strong>CWebApplication</strong>-><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->hasEventHandler('onBeginRequest')) <span class="ln">183</span> $this->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->processRequest(); </span><span class="ln">186</span> if($this->hasEventHandler('onEndRequest')) <span class="ln">187</span> $this->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"> #16 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> /home/sondages.pro/htdocs/clients/complets/draafbfc/LimeSurvey/index.php(194): <strong>CApplication</strong>-><strong>run</strong>() </div> <div class="code"><pre><span class="ln">189</span> require_once APPPATH . 'core/LSYii_Application' . EXT; <span class="ln">190</span> <span class="ln">191</span> $config = require_once(APPPATH . 'config/internal' . EXT); <span class="ln">192</span> <span class="ln">193</span> Yii::$enableIncludePath = false; <span class="error"><span class="ln error-ln">194</span> Yii::createApplication('LSYii_Application', $config)->run(); </span><span class="ln">195</span> <span class="ln">196</span> /* End of file index.php */ <span class="ln">197</span> /* Location: ./index.php */ </pre></div> </td> </tr> </tbody></table> </div> <div class="version"> 2018-04-24 11:50:42 Apache/2.2.22 (Debian) <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.18 </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> </body></html> | ||||
Bug heat | 8 | ||||
Complete LimeSurvey version number (& build) | 3.7.0 git | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | not relevant | ||||
Database type & version | not relevant | ||||
Server OS (if known) | not relevant | ||||
Webserver software & version (if known) | not relevant | ||||
PHP Version | not relevant | ||||
Have the fix but … unsure it's a real fix … em core are so … complicated … |
|
could be related to PHP 7 maybe? PHP 7.1: |
|
No, i'm on php 5.6 :) . and undefined offset is not related to PHP version. Quick fix : if(empty($errs[$errIndex++][1][1])) : show better the issue, must be a string and it's an aray: I think there are an issue about an array_merge VS array_push somewhere (real fix) |
|
It looks that Equation you wrote in 4th question isn't accepted by EM, probably IF part. |
|
BUT : even with badly written equation : EM must show error and don't broke Added another lss : ASSESSMENT_CURRENT_TOTAL issue |
|
https://github.com/LimeSurvey/LimeSurvey/pull/1180 Stil equation with error inside to test |
|
OK : current if an equation with error is used after : no error shown. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=28562 |
|
Fixed in version 3.17.3 |
|
LimeSurvey: master af310e8d 2018-11-25 18:09 Committer: GitHub Details Diff |
Fixed issue 13630: EM send Notice about Undefined offset Dev: Pull request (#1180) Dev: remove link on not valid variable (and qid is set here …) Fixed issue : Only partial error shown in logic file Dev: Previous system is totally broken , rewrite it Dev: adding $this->RDP_errs inside $this->RDP_errs : remove this … |
Affected Issues 13630 |
|
mod - application/config/version.php | Diff File | ||
mod - application/helpers/expressions/em_core_helper.php | Diff File | ||
mod - assets/scripts/admin/expression.js | Diff File | ||
mod - assets/styles-public/expressionlogicfile.css | Diff File | ||
mod - assets/styles-public/expressions.css | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-04-24 12:07 | DenisChenu | New Issue | |
2018-04-24 12:07 | DenisChenu | File Added: limesurvey_survey_EMnotice.lss | |
2018-04-24 12:07 | DenisChenu | File Added: PHP notice.html | |
2018-04-24 12:07 | DenisChenu | File Added: PHP notice_survey.html | |
2018-04-24 12:20 | DenisChenu | Note Added: 47510 | |
2018-05-23 10:57 |
|
Note Added: 47729 | |
2018-06-11 10:38 |
|
Assigned To | => dominikvitt |
2018-06-11 10:38 |
|
Status | new => assigned |
2018-06-11 11:04 | DenisChenu | Note Added: 48039 | |
2018-06-11 11:05 | DenisChenu | Note Edited: 48039 | |
2018-06-12 18:31 |
|
Note Added: 48069 | |
2018-11-22 19:22 | DenisChenu | File Added: limesurvey_survey_ASSESSMENT_CURRENT_TOTAL.lss | |
2018-11-22 19:22 | DenisChenu | Note Added: 49752 | |
2018-11-23 01:40 | DenisChenu | Assigned To | dominikvitt => DenisChenu |
2018-11-23 09:20 | DenisChenu | Note Added: 49754 | |
2018-11-23 09:21 | DenisChenu | Note Added: 49755 | |
2018-11-25 17:09 | DenisChenu | Changeset attached | => LimeSurvey master af310e8d |
2018-11-25 17:09 | DenisChenu | Note Added: 49774 | |
2018-11-25 17:09 | DenisChenu | Resolution | open => fixed |
2018-11-25 17:09 | DenisChenu | Status | assigned => resolved |
2018-11-25 17:09 | DenisChenu | Fixed in Version | => 3.15.x |
2019-04-30 09:13 | c_schmitz | Note Added: 51691 | |
2019-04-30 09:13 | c_schmitz | Status | resolved => closed |