more bug fixes
This commit is contained in:
parent
3c0c47014c
commit
a6e5450b64
12 changed files with 55 additions and 59 deletions
|
|
@ -366,7 +366,7 @@ sub getAssetAdderLinks {
|
|||
my $addToUrl = shift;
|
||||
my $type = shift || "assets";
|
||||
my %links;
|
||||
foreach my $class (@{$self->session->config->get("$type")}) {
|
||||
foreach my $class (@{$self->session->config->get($type)}) {
|
||||
next unless $class;
|
||||
my $load = "use ".$class;
|
||||
eval ($load);
|
||||
|
|
@ -967,7 +967,6 @@ sub getValue {
|
|||
my $self = shift;
|
||||
my $key = shift;
|
||||
if (defined $key) {
|
||||
# return $self->session->form->process("$key} if (exists $session{form}{$key")); # Security Hazard!
|
||||
my $storedValue = $self->get($key);
|
||||
return $storedValue if (defined $storedValue);
|
||||
unless (exists $self->{_propertyDefinitions}) { # check to see if the definitions have been merged and cached
|
||||
|
|
@ -1204,7 +1203,7 @@ sub processPropertiesFromFormPost {
|
|||
}
|
||||
foreach my $form ($self->session->request->param) {
|
||||
if ($form =~ /^metadata_(.*)$/) {
|
||||
$self->updateMetaData($1,$self->session->form->process("$form"));
|
||||
$self->updateMetaData($1,$self->session->form->process($form));
|
||||
}
|
||||
}
|
||||
$data{title} = "Untitled" unless ($data{title});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ use WebGUI::Operation::Profile;
|
|||
use WebGUI::ProfileField;
|
||||
use WebGUI::ProfileCategory;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::SQL;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset);
|
||||
|
||||
|
|
@ -463,8 +462,8 @@ sub getShortcutByCriteria {
|
|||
my $scratchId;
|
||||
if ($assetId) {
|
||||
$scratchId = "Shortcut_" . $assetId;
|
||||
if($self->session->scratch->get("$scratchId") && !$self->getValue("disableContentLock")) {
|
||||
return $self->session->scratch->get("$scratchId") unless ($self->session->var->get("adminOn"));
|
||||
if($self->session->scratch->get($scratchId) && !$self->getValue("disableContentLock")) {
|
||||
return $self->session->scratch->get($scratchId) unless ($self->session->var->get("adminOn"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use WebGUI::Group;
|
|||
use WebGUI::HTML;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Asset::Wobject;
|
||||
|
||||
|
|
@ -889,9 +888,9 @@ sub view {
|
|||
my $self = shift;
|
||||
my $scratchSortBy = $self->getId."_sortBy";
|
||||
my $scratchSortOrder = $self->getId."_sortDir";
|
||||
my $sortBy = $self->session->form->process("sortBy") || $self->session->scratch->get("$scratchSortBy") || $self->get("sortBy");
|
||||
my $sortOrder = $self->session->scratch->get("$scratchSortOrder") || $self->get("sortOrder");
|
||||
if ($sortBy ne $self->session->scratch->get("$scratchSortBy") && $self->session->form->process("func") ne "editSave") {
|
||||
my $sortBy = $self->session->form->process("sortBy") || $self->session->scratch->get($scratchSortBy) || $self->get("sortBy");
|
||||
my $sortOrder = $self->session->scratch->get($scratchSortOrder) || $self->get("sortOrder");
|
||||
if ($sortBy ne $self->session->scratch->get($scratchSortBy) && $self->session->form->process("func") ne "editSave") {
|
||||
$self->session->scratch->set($scratchSortBy,$self->session->form->process("sortBy"));
|
||||
} elsif ($self->session->form->process("sortBy") && $self->session->form->process("func") ne "editSave") {
|
||||
if ($sortOrder eq "asc") {
|
||||
|
|
@ -961,28 +960,28 @@ sub www_search {
|
|||
.WebGUI::Form::hidden($self->session,{ name=>"doit", value=>1 });
|
||||
$var{'all.form'} = WebGUI::Form::text({
|
||||
name=>'all',
|
||||
value=>$self->session->scratch->get("$self->getId."_all""),
|
||||
value=>$self->session->scratch->get($self->getId."_all"),
|
||||
size=>($self->session->setting->get("textBoxSize")-5)
|
||||
});
|
||||
$var{'exactphrase.form'} = WebGUI::Form::text({
|
||||
name=>'exactPhrase',
|
||||
value=>$self->session->scratch->get("$self->getId."_exactPhrase""),
|
||||
value=>$self->session->scratch->get($self->getId."_exactPhrase"),
|
||||
size=>($self->session->setting->get("textBoxSize")-5)
|
||||
});
|
||||
$var{'atleastone.form'} = WebGUI::Form::text({
|
||||
name=>'atLeastOne',
|
||||
value=>$self->session->scratch->get("$self->getId."_atLeastOne""),
|
||||
value=>$self->session->scratch->get($self->getId."_atLeastOne"),
|
||||
size=>($self->session->setting->get("textBoxSize")-5)
|
||||
});
|
||||
$var{'without.form'} = WebGUI::Form::text({
|
||||
name=>'without',
|
||||
value=>$self->session->scratch->get("$self->getId."_without""),
|
||||
value=>$self->session->scratch->get($self->getId."_without"),
|
||||
size=>($self->session->setting->get("textBoxSize")-5)
|
||||
});
|
||||
my %results;
|
||||
tie %results, 'Tie::IxHash';
|
||||
%results = (10=>'10', 25=>'25', 50=>'50', 100=>'100');
|
||||
my $numResults = $self->session->scratch->get("$self->getId."_numResults"") || $self->get("threadsPerPage");
|
||||
my $numResults = $self->session->scratch->get($self->getId."_numResults") || $self->get("threadsPerPage");
|
||||
$var{'results.form'} = WebGUI::Form::selectBox({
|
||||
name=>"numResults",
|
||||
options=>\%results,
|
||||
|
|
@ -996,10 +995,10 @@ sub www_search {
|
|||
if ($self->session->form->process("doit")) {
|
||||
my @fieldsToSearch = qw(assetData.title assetData.synopsis Post.content Post.username Post.userDefined1 Post.userDefined2 Post.userDefined3 Post.userDefined4 Post.userDefined5);
|
||||
my $all;
|
||||
if ($self->session->scratch->get("$self->getId."_all"") ne "") {
|
||||
$self->session->scratch->get("$self->getId."_all"") =~ s/,/ /g;
|
||||
$self->session->scratch->get("$self->getId."_all"") =~ s/\s+/ /g;
|
||||
my @words = split(/ /,$self->session->scratch->get("$self->getId."_all""));
|
||||
if ($self->session->scratch->get($self->getId."_all") ne "") {
|
||||
$self->session->scratch->get($self->getId."_all") =~ s/,/ /g;
|
||||
$self->session->scratch->get($self->getId."_all") =~ s/\s+/ /g;
|
||||
my @words = split(/ /,$self->session->scratch->get($self->getId."_all"));
|
||||
foreach my $word (@words) {
|
||||
$all .= " and " if ($all ne "");
|
||||
$all .= "(";
|
||||
|
|
@ -1014,17 +1013,17 @@ sub www_search {
|
|||
}
|
||||
}
|
||||
my $exactPhrase;
|
||||
if ($self->session->scratch->get("$self->getId."_exactPhrase"") ne "") {
|
||||
if ($self->session->scratch->get($self->getId."_exactPhrase") ne "") {
|
||||
foreach my $field (@fieldsToSearch) {
|
||||
$exactPhrase .= " or " if ($exactPhrase ne "");
|
||||
$exactPhrase .= " $field like ".$self->session->db->quote("%".$self->session->scratch->get("$self->getId."_exactPhrase"")."%");
|
||||
$exactPhrase .= " $field like ".$self->session->db->quote("%".$self->session->scratch->get($self->getId."_exactPhrase")."%");
|
||||
}
|
||||
}
|
||||
my $atLeastOne;
|
||||
if ($self->session->scratch->get("$self->getId."_atLeastOne"") ne "") {
|
||||
$self->session->scratch->get("$self->getId."_atLeastOne"") =~ s/,/ /g;
|
||||
$self->session->scratch->get("$self->getId."_atLeastOne"") =~ s/\s+/ /g;
|
||||
my @words = split(/ /,$self->session->scratch->get("$self->getId."_atLeastOne""));
|
||||
if ($self->session->scratch->get($self->getId."_atLeastOne") ne "") {
|
||||
$self->session->scratch->get($self->getId."_atLeastOne") =~ s/,/ /g;
|
||||
$self->session->scratch->get($self->getId."_atLeastOne") =~ s/\s+/ /g;
|
||||
my @words = split(/ /,$self->session->scratch->get($self->getId."_atLeastOne"));
|
||||
foreach my $word (@words) {
|
||||
foreach my $field (@fieldsToSearch) {
|
||||
$atLeastOne .= " or " if ($atLeastOne ne "");
|
||||
|
|
@ -1033,10 +1032,10 @@ sub www_search {
|
|||
}
|
||||
}
|
||||
my $without;
|
||||
if ($self->session->scratch->get("$self->getId."_without"") ne "") {
|
||||
$self->session->scratch->get("$self->getId."_without"") =~ s/,/ /g;
|
||||
$self->session->scratch->get("$self->getId."_without"") =~ s/\s+/ /g;
|
||||
my @words = split(/ /,$self->session->scratch->get("$self->getId."_without""));
|
||||
if ($self->session->scratch->get($self->getId."_without") ne "") {
|
||||
$self->session->scratch->get($self->getId."_without") =~ s/,/ /g;
|
||||
$self->session->scratch->get($self->getId."_without") =~ s/\s+/ /g;
|
||||
my @words = split(/ /,$self->session->scratch->get($self->getId."_without"));
|
||||
foreach my $word (@words) {
|
||||
foreach my $field (@fieldsToSearch) {
|
||||
$without .= " and " if ($without ne "");
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ sub _createField {
|
|||
my %param;
|
||||
$param{name} = $data->{name};
|
||||
$param{name} = "field_".$data->{sequenceNumber} if ($param{name} eq ""); # Empty fieldname not allowed
|
||||
$self->session->form->process("$param{name}") =~ s/\^.*?\;//gs ; # remove macro's from user input
|
||||
$self->session->form->process($param{name}) =~ s/\^.*?\;//gs ; # remove macro's from user input
|
||||
$param{value} = $data->{value};
|
||||
$param{size} = $data->{width};
|
||||
$param{rows} = $data->{rows} || 5;
|
||||
|
|
@ -44,7 +44,7 @@ sub _createField {
|
|||
}
|
||||
if (isIn($data->{type},qw(selectList checkList))) {
|
||||
my @defaultValues;
|
||||
if ($self->session->form->process("$param{name}")) {
|
||||
if ($self->session->form->process($param{name})) {
|
||||
@defaultValues = $self->session->form->selectList($param{name});
|
||||
} else {
|
||||
foreach (split(/\n/, $data->{value})) {
|
||||
|
|
@ -424,7 +424,7 @@ sub getRecordTemplateVars {
|
|||
my @fields;
|
||||
my $sth = $self->session->db->read("$select from DataForm_field as a $join $where and a.DataForm_tabId=".$self->session->db->quote($tab{DataForm_tabId})." order by a.sequenceNumber");
|
||||
while (%data = $sth->hash) {
|
||||
my $formValue = $self->session->form->process("$data{name}");
|
||||
my $formValue = $self->session->form->process($data{name});
|
||||
if ((not exists $data{value}) && $self->session->form->process("func") ne "editSave" && $self->session->form->process("func") ne "editFieldSave" && defined $formValue) {
|
||||
$data{value} = $formValue;
|
||||
$data{value} = $self->session->datetime->setToEpoch($data{value}) if ($data{type} eq "date");
|
||||
|
|
@ -468,7 +468,7 @@ sub getRecordTemplateVars {
|
|||
my @fields;
|
||||
my $sth = $self->session->db->read("$select from DataForm_field as a $join $where and a.DataForm_tabId = 0 order by a.sequenceNumber");
|
||||
while (%data = $sth->hash) {
|
||||
my $formValue = $self->session->form->process("$data{name}");
|
||||
my $formValue = $self->session->form->process($data{name});
|
||||
if ((not exists $data{value}) && $self->session->form->process("func") ne "editSave" && $self->session->form->process("func") ne "editFieldSave" && defined $formValue) {
|
||||
$data{value} = $formValue;
|
||||
$data{value} = $self->session->datetime->setToEpoch($data{value}) if ($data{type} eq "date");
|
||||
|
|
|
|||
|
|
@ -759,11 +759,11 @@ sub www_rate {
|
|||
if ($first) {
|
||||
$first=0;
|
||||
} else {
|
||||
if ($lastRating != $self->session->form->process("$category")) {
|
||||
if ($lastRating != $self->session->form->process($category)) {
|
||||
$sameRating = 0;
|
||||
}
|
||||
}
|
||||
$lastRating = $self->session->form->process("$category");
|
||||
$lastRating = $self->session->form->process($category);
|
||||
}
|
||||
return $self->www_viewDetail("",1) if ($hasRated || $sameRating); # Throw out ratings that are all the same number, or if the user rates twice.
|
||||
$self->setRatings($self->session->form->process("listingId"),$session{form});
|
||||
|
|
@ -783,14 +783,13 @@ sub www_search {
|
|||
}
|
||||
my $sth = $self->session->db->read("select name,fieldType from Matrix_field");
|
||||
while (my ($name,$fieldType) = $sth->array) {
|
||||
next unless ($self->session->form->process("$name"));
|
||||
next unless ($self->session->form->process($name));
|
||||
push(@list,0);
|
||||
my $where;
|
||||
if ($fieldType ne "goodBad") {
|
||||
$where = "("
|
||||
."a.value like ".$self->session->db->quote("%".$self->session->form->process("$name")."%")
|
||||
."a.value like ".$self->session->db->quote("%".$self->session->form->process($name)."%")
|
||||
." or a.value='Any'"
|
||||
#." or a.value<".$self->session->db->quote($self->session->form->process("$name"))
|
||||
." or a.value='Free'"
|
||||
.")";
|
||||
} else {
|
||||
|
|
@ -842,13 +841,13 @@ sub www_search {
|
|||
if ($data->{fieldType} ne "goodBad") {
|
||||
$data->{form} = WebGUI::Form::text({
|
||||
name=>$data->{name},
|
||||
value=>$self->session->form->process("$data->{name}")
|
||||
value=>$self->session->form->process($data->{name})
|
||||
});
|
||||
} else {
|
||||
$data->{form} = WebGUI::Form::checkbox({
|
||||
name=>$data->{name},
|
||||
value=>"1",
|
||||
checked=>$self->session->form->process("$data->{name}")
|
||||
checked=>$self->session->form->process($data->{name})
|
||||
});
|
||||
}
|
||||
push(@loop,$data);
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ sub _parsePlaceholderParams {
|
|||
my ($type,$field) = split(/:/,$row);
|
||||
my $param;
|
||||
if($type =~ /^form/) {
|
||||
$param = $self->session->form->process("$field");
|
||||
$param = $self->session->form->process($field);
|
||||
} elsif ($type =~ /^query(\d)/) {
|
||||
$param = $self->{_query}{$1}{rowData}{$field};
|
||||
}
|
||||
|
|
@ -332,7 +332,7 @@ sub _processQuery {
|
|||
foreach (keys %{$session{form}}) {
|
||||
unless ($_ eq "pn" || $_ eq "func" || $_ =~ /identifier/i || $_ =~ /password/i) {
|
||||
$url = $self->session->url->append($url, $self->session->url->escape($_)
|
||||
.'='.$self->session->url->escape($self->session->form->process("$_")));
|
||||
.'='.$self->session->url->escape($self->session->form->process($_)));
|
||||
}
|
||||
}
|
||||
my $paginateAfter = $self->get("paginateAfter");
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ sub duplicate {
|
|||
sub generateResponseId {
|
||||
my $self = shift;
|
||||
my $varname = $self->getResponseIdString;
|
||||
if ($self->session->scratch->get("$varname")) {
|
||||
if ($self->session->scratch->get($varname)) {
|
||||
$self->completeResponse;
|
||||
}
|
||||
my $ipAddress = $self->getIp;
|
||||
|
|
@ -529,7 +529,7 @@ sub getSectionDrivenQuestionIds {
|
|||
#-------------------------------------------------------------------
|
||||
sub getResponseId {
|
||||
my $self = shift;
|
||||
return $self->session->scratch->get("$self->getResponseIdString");
|
||||
return $self->session->scratch->get($self->getResponseIdString);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1166,14 +1166,14 @@ sub www_respond {
|
|||
my $self = shift;
|
||||
return "" unless ($self->session->user->isInGroup($self->get("groupToTakeSurvey")));
|
||||
my $varname = $self->getResponseIdString;
|
||||
return "" unless ($self->session->scratch->get("$varname"));
|
||||
return "" unless ($self->session->scratch->get($varname));
|
||||
my $userId = ($self->get("anonymous")) ? substr(md5_hex($self->session->user->profileField("userId")),0,8) : $self->session->user->profileField("userId");
|
||||
my $terminate = 0;
|
||||
foreach my $key (keys %{$session{form}}) {
|
||||
if ($key =~ /^answerId_(.+)$/) {
|
||||
my $id = $1;
|
||||
my ($previousResponse) = $self->session->db->quickArray("select count(*) from Survey_questionResponse
|
||||
where Survey_answerId=".$self->session->db->quote($self->session->form->process(""answerId_".$id"))." and Survey_responseId=".$self->session->db->quote($self->session->scratch->get("$varname")));
|
||||
where Survey_answerId=".$self->session->db->quote($self->session->form->process(""answerId_".$id"))." and Survey_responseId=".$self->session->db->quote($self->session->scratch->get($varname)));
|
||||
next if ($previousResponse);
|
||||
my $answer = $self->getCollateral("Survey_answer","Survey_answerId",$self->session->form->process(""answerId_".$id"));
|
||||
if ($self->get("questionOrder") eq "response" && $answer->{gotoQuestion} eq "") {
|
||||
|
|
@ -1181,16 +1181,16 @@ sub www_respond {
|
|||
}
|
||||
my $response = $self->session->form->process(""textResponse_".$id} || $answer->{answer");
|
||||
$self->session->db->write("insert into Survey_questionResponse (Survey_answerId,Survey_questionId,Survey_responseId,Survey_id,comment,response,dateOfResponse) values (
|
||||
".$self->session->db->quote($answer->{Survey_answerId}).", ".$self->session->db->quote($answer->{Survey_questionId}).", ".$self->session->db->quote($self->session->scratch->get("$varname}).", ".$self->session->db->quote($answer->{Survey_id")).",
|
||||
".$self->session->db->quote($answer->{Survey_answerId}).", ".$self->session->db->quote($answer->{Survey_questionId}).", ".$self->session->db->quote($self->session->scratch->get($varname).", ".$self->session->db->quote($answer->{Survey_id}).",
|
||||
".$self->session->db->quote($self->session->form->process(""comment_".$id")).", ".$self->session->db->quote($response).", ".$self->session->datetime->time().")");
|
||||
}
|
||||
}
|
||||
my $responseCount = $self->getQuestionResponseCount($self->session->scratch->get("$varname"));
|
||||
my $responseCount = $self->getQuestionResponseCount($self->session->scratch->get($varname));
|
||||
if ($terminate || $responseCount >= $self->getValue("questionsPerResponse") || $responseCount >= $self->getQuestionCount) {
|
||||
$self->session->db->setRow("Survey_response","Survey_responseId",{
|
||||
isComplete=>1,
|
||||
endDate=>$self->session->datetime->time(),
|
||||
Survey_responseId=>$self->session->scratch->get("$varname")
|
||||
Survey_responseId=>$self->session->scratch->get($varname)
|
||||
});
|
||||
}
|
||||
$self->logView() if ($self->session->setting->get("passiveProfilingEnabled"));
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ sub www_editBranchSave {
|
|||
if ($form =~ /^metadata_(.*)$/) {
|
||||
my $fieldName = $1;
|
||||
if ($self->session->form->yesNo("change_metadata_".$fieldName)) {
|
||||
$newRevision->updateMetaData($fieldName,$self->session->form->process("$form"));
|
||||
$newRevision->updateMetaData($fieldName,$self->session->form->process($form));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ sub getSetting {
|
|||
my $self = shift;
|
||||
my $setting = $_[0];
|
||||
$setting = lc($self->authMethod).ucfirst($setting);
|
||||
return $self->session->setting->get("$setting");
|
||||
return $self->session->setting->get($setting);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -521,10 +521,10 @@ sub www_editCommerceSettingsSave {
|
|||
type => $1,
|
||||
namespace => $2,
|
||||
fieldName => $3,
|
||||
fieldValue => $session->form->process("$_")
|
||||
fieldValue => $session->form->process($_)
|
||||
});
|
||||
} elsif ($_ ne 'op') {
|
||||
WebGUI::Setting::set($_,$session->form->process("$_"));
|
||||
WebGUI::Setting::set($_,$session->form->process($_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -770,7 +770,7 @@ my $shoppingCart = WebGUI::Commerce::ShoppingCart->new;
|
|||
|
||||
foreach my $formElement (keys(%{$session{form}})) {
|
||||
if ($formElement =~ m/^quantity~([^~]*)~([^~]*)$/) {
|
||||
$shoppingCart->setQuantity($2, $1, $session->form->process("$formElement"));
|
||||
$shoppingCart->setQuantity($2, $1, $session->form->process($formElement));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ sub www_editSubscriptionSave {
|
|||
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
|
||||
|
||||
@relevantFields = qw(subscriptionId name price description subscriptionGroup duration executeOnSubscription karma);
|
||||
WebGUI::Subscription->new($session,$session->form->process("sid"))->set({map {$_ => $session->form->process("$_}} @relevantFields"));
|
||||
WebGUI::Subscription->new($session,$session->form->process("sid"))->set({map {$_ => $session->form->process($_)} @relevantFields);
|
||||
|
||||
return www_listSubscriptions();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,12 +143,12 @@ sub formField {
|
|||
}
|
||||
$properties->{options} = $orderedValues;
|
||||
my $default;
|
||||
if ($self->session->form->process("$properties->{name}")) {
|
||||
$default = $self->session->form->process("$properties->{name}");
|
||||
if ($self->session->form->process($properties->{name})) {
|
||||
$default = $self->session->form->process($properties->{name});
|
||||
} elsif (defined $u && $u->profileField($properties->{name})) {
|
||||
$default = $u->profileField($properties->{name});
|
||||
} elsif (!defined $u && $self->session->user->profileField("$properties->{name}")) {
|
||||
$default = $self->session->user->profileField("$properties->{name}");
|
||||
} elsif (!defined $u && $self->session->user->profileField($properties->{name})) {
|
||||
$default = $self->session->user->profileField($properties->{name});
|
||||
} else {
|
||||
$default = WebGUI::Operation::Shared::secureEval($properties->{dataDefault});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue