Skip to content

Commit

Permalink
Fixed issue #10646: No error msg when validating registration form
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Mar 7, 2016
1 parent 8f99ed4 commit a53ba3c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions application/controllers/RegisterController.php
Expand Up @@ -154,10 +154,9 @@ public function getRegisterErrors($iSurveyId){
}
}

public function getRegisterForm($iSurveyId){

public function getRegisterForm($iSurveyId)
{
$aSurveyInfo=getSurveyInfo($iSurveyId,App()->language);
$sTemplate=getTemplatePath($aSurveyInfo['template']);

// Event to replace register form
$event = new PluginEvent('beforeRegisterForm');
Expand Down Expand Up @@ -197,8 +196,9 @@ public function getRegisterForm($iSurveyId){
$aData['thissurvey'] = $aSurveyInfo;
Yii::app()->setConfig('surveyID',$iSurveyId);//Needed for languagechanger
$aData['languagechanger'] = makeLanguageChangerSurvey(App()->language);

$oTemplate = Template::model()->getInstance($sTemplate);
global $oTemplate;
$oTemplate = new TemplateConfiguration;
$oTemplate->setTemplateConfiguration('',$iSurveyId);
return templatereplace(file_get_contents($oTemplate->viewPath . "/register.pstpl"),$aReplacement,$aData);
}

Expand Down
4 changes: 2 additions & 2 deletions application/models/TemplateConfiguration.php
Expand Up @@ -99,15 +99,15 @@ public function setTemplateConfiguration($sTemplateName='', $iSurveyId='')
else
{
$this->path = Yii::app()->getConfig("standardtemplaterootdir").DIRECTORY_SEPARATOR.$this->sTemplateName;
$this->xmlFile = $this->path.'config.xml';
$this->xmlFile = $this->path.DIRECTORY_SEPARATOR.'config.xml';
}

}
else
{
$this->xmlFile = $this->path.DIRECTORY_SEPARATOR.'config.xml';
}

//var_dump(realpath ($this->xmlFile)); die();
$this->config = simplexml_load_file(realpath ($this->xmlFile));

// The template configuration.
Expand Down
3 changes: 2 additions & 1 deletion application/views/register/display.php
@@ -1,5 +1,6 @@
<?php
$oTemplate = Template::model()->getInstance($sTemplate);
global $oTemplate;

echo templatereplace(file_get_contents($oTemplate->viewPath."startpage.pstpl"),array(),$aData);
echo templatereplace(file_get_contents($oTemplate->viewPath."survey.pstpl"),array(),$aData);
echo $content;
Expand Down
2 changes: 1 addition & 1 deletion templates/default/views/register.pstpl
@@ -1,4 +1,4 @@
<span class="warning-text">{REGISTERERROR}</span>
<div class="alert alert-danger" role="alert">{REGISTERERROR}</div>
<p class="register-message-1">{REGISTERMESSAGE1}</p>
<p class="register-message-2">{REGISTERMESSAGE2}</p>
<div class="register-form">{REGISTERFORM}</div>
2 changes: 1 addition & 1 deletion templates/news_paper/views/register.pstpl
@@ -1,4 +1,4 @@
<span class="warning-text">{REGISTERERROR}</span>
<div class="alert alert-danger" role="alert">{REGISTERERROR}</div>
<p class="register-message-1">{REGISTERMESSAGE1}</p>
<p class="register-message-2">{REGISTERMESSAGE2}</p>
<div class="register-form">{REGISTERFORM}</div>
2 changes: 1 addition & 1 deletion templates/ubuntu_orange/views/register.pstpl
@@ -1,4 +1,4 @@
<span class="warning-text">{REGISTERERROR}</span>
<div class="alert alert-danger" role="alert">{REGISTERERROR}</div>
<p class="register-message-1">{REGISTERMESSAGE1}</p>
<p class="register-message-2">{REGISTERMESSAGE2}</p>
<div class="register-form">{REGISTERFORM}</div>

0 comments on commit a53ba3c

Please sign in to comment.