Skip to content

Commit

Permalink
Merge pull request #54 from machaven/master
Browse files Browse the repository at this point in the history
Fixed issue #6882: Renaming a template lose the parameters of a questionnaire.
  • Loading branch information
machaven committed Nov 20, 2012
2 parents e3d0b5a + 2e8cc2b commit 05889db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions application/controllers/admin/templates.php
Expand Up @@ -398,7 +398,8 @@ public function templaterename()
{
if (returnGlobal('action') == "templaterename" && returnGlobal('newname') && returnGlobal('copydir')) {
$clang = Yii::app()->lang;
$newname=sanitize_paranoid_string(returnGlobal('newname'));
$oldname = sanitize_paranoid_string(returnGlobal('copydir'));
$newname = sanitize_paranoid_string(returnGlobal('newname'));
$newdirname = Yii::app()->getConfig('usertemplaterootdir') . "/" . $newname;
$olddirname = Yii::app()->getConfig('usertemplaterootdir') . "/" . returnGlobal('copydir');
if (isStandardTemplate(returnGlobal('newname')))
Expand All @@ -407,8 +408,8 @@ public function templaterename()
$this->getController()->error(sprintf($clang->gT("Directory could not be renamed to `%s`.", "js"), $newname) . " " . $clang->gT("Maybe you don't have permission.", "js"));
else
{
$templatename = $newname;
$this->index("startpage.pstpl", "welcome", $templatename);
Survey::model()->updateAll(array( 'template' => $newname ), "template = '{$oldname}'" );
$this->index("startpage.pstpl", "welcome", $newname);
}
}
}
Expand Down

0 comments on commit 05889db

Please sign in to comment.