Skip to content

Commit

Permalink
Fixed issue #17256: No warning about adjusted question codes is shown…
Browse files Browse the repository at this point in the history
… when importing a group which holds questions with already used question codes (#1859)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed May 3, 2021
1 parent 20e60eb commit b434183
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions application/helpers/admin/import_helper.php
Expand Up @@ -587,6 +587,15 @@ function XMLImportGroup($sFullFilePath, $iNewSID, $bTranslateLinksFields)
LimeExpressionManager::RevertUpgradeConditionsToRelevance($iNewSID);
LimeExpressionManager::UpgradeConditionsToRelevance($iNewSID);

if (count($aQuestionCodeReplacements)) {
array_unshift(
$results['importwarnings'],
"<span class='warningtitle'>"
. gT('Attention: Several question codes were updated. Please check these carefully as the update may not be perfect with customized expressions.')
. '</span>'
);
}

$results['newgid'] = $newgid;
$results['labelsets'] = 0;
$results['labels'] = 0;
Expand Down
11 changes: 11 additions & 0 deletions application/views/questionGroupsAdministration/import_view.php
Expand Up @@ -37,6 +37,17 @@
<li><?php echo gT("Question attributes:") . $aImportResults['question_attributes'] ?></li>
</ul>
</p>

<!-- Warnings -->
<?php if (count($aImportResults['importwarnings'])>0): ?>
<h2 class="warning"><?php eT("Warnings");?>:</h2>
<ul class="list-unstyled">
<?php foreach ($aImportResults['importwarnings'] as $warning): ?>
<li><?php echo $warning; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

<p class="text-info"><?php eT("Question group import is complete.") ?></p>

<!-- button -->
Expand Down

0 comments on commit b434183

Please sign in to comment.