Fixed a bug where having poll with no answers would cause the poll wobject to crash.
Fixed a bug where the reset votes option in the poll would become mangled if the anti-caching mechanism was enabled.
This commit is contained in:
parent
9eae4862e0
commit
d3446049d3
2 changed files with 7 additions and 5 deletions
|
|
@ -58,10 +58,12 @@ sub randint {
|
||||||
sub randomizeArray {
|
sub randomizeArray {
|
||||||
my ($array, $i, $j);
|
my ($array, $i, $j);
|
||||||
$array = shift;
|
$array = shift;
|
||||||
for ($i = @$array; --$i; ) {
|
if ($#$array > 0) {
|
||||||
$j = int rand ($i+1);
|
for ($i = @$array; --$i; ) {
|
||||||
next if $i == $j;
|
$j = int rand ($i+1);
|
||||||
@$array[$i,$j] = @$array[$j,$i];
|
next if $i == $j;
|
||||||
|
@$array[$i,$j] = @$array[$j,$i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ sub www_edit {
|
||||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||||
if ($_[0]->get("wobjectId") ne "new") {
|
if ($_[0]->get("wobjectId") ne "new") {
|
||||||
$output .= '<p>';
|
$output .= '<p>';
|
||||||
$output .= '<a href="'.WebGUI::URL::page('func=resetVotes&wid='.$_[0]->get("wobjectId").'">')
|
$output .= '<a href="'.WebGUI::URL::page('func=resetVotes&wid='.$_[0]->get("wobjectId")).'">'
|
||||||
.WebGUI::International::get(10,$namespace).'</a>';
|
.WebGUI::International::get(10,$namespace).'</a>';
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue