Remove debug output from DataForm
Update Wobject.pm to use placeholders. This will speed up reordering collateral a lot. Fixes for sequenceNumbers for answers in surveys. Upgrade script fixes sequenceNumbers for all existing surveys.
This commit is contained in:
parent
0d1c1ea96a
commit
776a6bfdcc
5 changed files with 33 additions and 7 deletions
|
|
@ -24,6 +24,7 @@
|
|||
purge, and changeUrl
|
||||
- fix: editing posts loses changes in preview
|
||||
- change: Asset::getContainer no longer changes the session asset
|
||||
- fix: Survey numeric multiple choice options
|
||||
|
||||
7.1.4
|
||||
- Template variables in the main Survey Template were out of date in the
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ addRssUrlMacroProcessing($session);
|
|||
addLastExportedAs($session);
|
||||
addDeletionWorkflows($session);
|
||||
addRSSFromParent($session);
|
||||
reorderSurveyCollateral($session);
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
|
|
@ -180,6 +181,27 @@ EOT
|
|||
$oldTag->setWorking if $oldTag;
|
||||
}
|
||||
|
||||
##-------------------------------------------------
|
||||
sub reorderSurveyCollateral {
|
||||
my $session = shift;
|
||||
print "\tFixing ordering problems with Survey answers.\n" unless ($quiet);
|
||||
# and here's our code
|
||||
my $sth1 = $session->db->prepare("select distinct(assetId) from Survey");
|
||||
my $sth2 = $session->db->prepare("select Survey_questionId from Survey_question where Survey_Id=?");
|
||||
$sth1->execute();
|
||||
while (my ($assetId) = $sth1->array) { ##Iterate over all surveys
|
||||
my $survey = WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Wobject::Survey');
|
||||
my $Survey_Id = $survey->get('Survey_id');
|
||||
$sth2->execute([$Survey_Id]);
|
||||
while (my ($questionId) = $sth2->array) { ##iterate over all questions in the survey
|
||||
$session->errorHandler->warn($questionId);
|
||||
$survey->reorderCollateral("Survey_answer", "Survey_answerId","Survey_questionId", $questionId);
|
||||
}
|
||||
$sth2->finish;
|
||||
}
|
||||
$sth1->finish;
|
||||
}
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE ----
|
||||
|
||||
#-------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue