diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt
index 5af668222..a49c0660c 100644
--- a/docs/changelog/6.x.x.txt
+++ b/docs/changelog/6.x.x.txt
@@ -62,6 +62,52 @@
- Added CDG Commerce iTransact payment plugin.
+6.2.11
+ - Fixed a navigation problem where home page was not showing up.
+ - fix [ 1111452 ] 6.2.10 showDebug=1 in create.sql
+ - Removed fix 1079821 as it caused an ugly post bug defined as [ 1111591 ] Message Preview problems. (Duplicate message)
+ - fix [ 1111490 ] Calendar events in 6.2.10 (Matt Wilson)
+
+
+6.2.10
+ - A lot of help updates (Colin Kuskie)
+ - A bunch of GUID fixes (Eric Kennedy)
+ - fix [ 1102676 ] Re-visit 920583 Theme imports fail (Gerald Young)
+ - fix [ 1085795 ] Wrong parameter count to WebGUI/Group.pm (Dri)
+ - fix [ 1085485 ] parentId in page table not an int
+ - fix [ 1080299 ] Home page can be deleted
+ - fix [ 1071435 ] AdminBar macro incorrectly selects packages
+ - fix [ 1080326 ] DeleteExpiredTrash doesn't work
+ - Fixed the version compare bug in testEnvironment.pl and statistics due to
+ the missing status.
+ - fix [ 1072107 ] Calling ^SI(); by id doesn't work. (Dri)
+ - fix [ 1055088 ] SI macro will not do by ID look-up
+ - fix [ 1074036 ] Eventscalendar : very slow (Milo vd Zee)
+ - fix [ 1069991 ] Deleted msg - problems in nested, threaded views (mdj2000)
+ - fix [ 1108905 ] WebGUI::Mail charset inconsistency (fix) (Dri)
+ - fix [ 1108539 ] Profile issues
+ - fix [ 1096397 ] Data Form mail acknowledgement
+ - fix [ 1095532 ] Deploying package with sub-pages fails
+ - fix [ 1089383 ] message log URL missing operation name
+ - fix [ 1088470 ] missing '>' in template (create.sql) - minor. (Matt Wilson)
+ - fix [ 1080783 ] Profile field issue
+ - fix [ 1079821 ] Make printable macro ignores POST variables (rainer)
+ - fix [ 1078370 ] CPU Spike- UNKNOWN CAUSE
+ - fix [ 1078488 ] bad slashes in thumbnail
+ - fix [ 1077905 ] Post Preview template won't load. templateId 1 hardcoded!! (mdj2000)
+ - fix [ 1071941 ] Time Zone
+ - fix [ 1076678 ] Infinite loop with snippet
+ - fix [ 1075290 ] forum template subscription problem
+ - fix [ 1072838 ] FIX -- LDAP Auth: Sign up with existing WG username crashes
+ (Roy Johnson)
+ - fix [ 1066778 ] www.plainblack.com/news?wid=920&func=viewRSS (Dri)
+ - fix [ 1070169 ] 6.2.9 - Template create problem
+ - fix [ 1110644 ] Eventscalender month crossing bug (Milo van der Zee)
+ - fixed a template switching problem in the 6.0.0 upgrade script.
+ - fix [ 1071229 ] unauthorized user can view submissions!
+
+
+
6.2.9
- bugfix [ 1058105 ] input tag has to be closed with /
- Changed a bunch of comparison operators that could potentially break with
diff --git a/docs/gotcha.txt b/docs/gotcha.txt
index 484759c7e..1c21116ec 100644
--- a/docs/gotcha.txt
+++ b/docs/gotcha.txt
@@ -41,12 +41,6 @@ save you many hours of grief.
changed significantly enough that automatic migration of them is
not possible.
- * The recommended default location for the WebGUI log is now
- /var/log/webgui.log instead of /data/webgui.log
-
- * The default path for WebGUI backups is now /tmp/backups rather than
- /data/backups
-
* You may add optional protection for your uploaded WebGUI files. This
will check the privileges of the files from the WebGUI database
before sending them to the browser. To enable this you must use
@@ -66,6 +60,15 @@ save you many hours of grief.
there have been many changes to the API in this release.
+6.2.10
+--------------------------------------------------------------------
+ * The recommended default location for the WebGUI log is now
+ /var/log/webgui.log instead of /data/webgui.log
+
+ * The default path for WebGUI backups is now /tmp/backups rather than
+ /data/backups
+
+
6.2.8
--------------------------------------------------------------------
* Due to a bug in the theme system, if you created any themes in any
diff --git a/docs/upgrades/upgrade_5.9.9-6.0.0.pl b/docs/upgrades/upgrade_5.9.9-6.0.0.pl
index 1e62572ae..9fe570160 100644
--- a/docs/upgrades/upgrade_5.9.9-6.0.0.pl
+++ b/docs/upgrades/upgrade_5.9.9-6.0.0.pl
@@ -84,10 +84,10 @@ if ( grep /^style$/i, @tables ){
my ($newStyleId) = WebGUI::SQL->quickArray("select max(templateId) from template where namespace='style'");
if ($style->{styleId} > 0 && $style->{styleId} < 25) {
$newStyleId = $style->{styleId};
- } elsif ($newStyleId > 999) {
+ } elsif ($newStyleId > 9999) {
$newStyleId++;
} else {
- $newStyleId = 1000;
+ $newStyleId = 10000;
}
my $newStyle = $session{setting}{docTypeDec}.'
@@ -103,7 +103,7 @@ if ( grep /^style$/i, @tables ){
';
WebGUI::SQL->write("insert into template (templateId, name, template, namespace) values (".$newStyleId.",
".quote($style->{name}).", ".quote($newStyle).", 'style')");
- WebGUI::SQL->write("update page set styleId=".$newStyleId." where styleId=".$style->{styleId});
+ WebGUI::SQL->write("update page set styleId=".quote($newStyleId)." where styleId=".quote($style->{styleId}));
WebGUI::SQL->write("update themeComponent set id=".$newStyleId.", type='template' where id=".$style->{styleId}." and type='style'");
}
$sth->finish;
@@ -886,7 +886,8 @@ $replace{'t'} = {
my ($sth, $data, $code, $table, $column, %identifier);
foreach $table (keys %dbFields){
- unless ($sth = WebGUI::SQL->read("SELECT * FROM $table")) {die "Cannot read from table $table ";}
+ $sth = WebGUI::SQL->read("SELECT * FROM $table");
+ #unless ($sth = WebGUI::SQL->read("SELECT * FROM $table")) {die "Cannot read from table $table ";}
while ($data = $sth->hashRef){
foreach $column (@{$dbFields{$table}{fields}}){
$code = $data->{$column};
diff --git a/docs/upgrades/upgrade_6.2.10-6.2.11.sql b/docs/upgrades/upgrade_6.2.10-6.2.11.sql
new file mode 100644
index 000000000..4dd1f1d4a
--- /dev/null
+++ b/docs/upgrades/upgrade_6.2.10-6.2.11.sql
@@ -0,0 +1,4 @@
+insert into webguiVersion values ('6.2.11','upgrade',unix_timestamp());
+update page set isSystem=0, parentId='0' where pageId='1';
+
+
diff --git a/docs/upgrades/upgrade_6.2.9-6.3.0.pl b/docs/upgrades/upgrade_6.2.11-6.3.0.pl
similarity index 100%
rename from docs/upgrades/upgrade_6.2.9-6.3.0.pl
rename to docs/upgrades/upgrade_6.2.11-6.3.0.pl
diff --git a/docs/upgrades/upgrade_6.2.9-6.3.0.sql b/docs/upgrades/upgrade_6.2.11-6.3.0.sql
similarity index 100%
rename from docs/upgrades/upgrade_6.2.9-6.3.0.sql
rename to docs/upgrades/upgrade_6.2.11-6.3.0.sql
diff --git a/docs/upgrades/upgrade_6.2.9-6.2.10.sql b/docs/upgrades/upgrade_6.2.9-6.2.10.sql
new file mode 100644
index 000000000..7118bba45
--- /dev/null
+++ b/docs/upgrades/upgrade_6.2.9-6.2.10.sql
@@ -0,0 +1,8 @@
+insert into webguiVersion values ('6.2.10','upgrade',unix_timestamp());
+update page set isSystem=1, parentId='0' where pageId='1';
+delete from template where templateId='1' and namespace='USS/Submission';
+INSERT INTO template VALUES ('1','Default Submission','
\n\n\n
\n\n \" border=\"0\">\n\n\n \n\n |
\n\n','USS/Submission',1,1);
+delete from template where templateId='1' and namespace='Forum/Thread';
+INSERT INTO template VALUES ('1','Default Thread','
\r\n\r\n\r\n \r\n
\r\n\r\n \r\n \">\r\n \r\n style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n
\r\n style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n \r\n \r\n
\r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n | | \r\n \r\n \r\n \">\r\n \r\n style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n \r\n style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n \r\n \r\n \r\n | \r\n
\r\n
\r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n | \"> | \r\n \r\n | \r\n \r\n \"> | \r\n \r\n @ | \r\n
\r\n \r\n
\r\n\r\n\r\n\r\n\"> •\r\n\"> •\r\n\"> \r\n\r\n • \">\r\n \r\n •\r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n \r\n \">\r\n \r\n \r\n\r\n\r\n •\r\n \r\n \">\r\n \r\n \">\r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n','Forum/Thread',1,1);
+
+
diff --git a/lib/WebGUI/Asset/Wobject/Poll.pm b/lib/WebGUI/Asset/Wobject/Poll.pm
index 4fbe0919e..c46b743f8 100644
--- a/lib/WebGUI/Asset/Wobject/Poll.pm
+++ b/lib/WebGUI/Asset/Wobject/Poll.pm
@@ -29,7 +29,7 @@ sub _hasVoted {
my $self = shift;
my ($hasVoted) = WebGUI::SQL->quickArray("select count(*) from Poll_answer
where assetId=".quote($self->getId)." and ((userId=".quote($session{user}{userId})."
- and userId<>1) or (userId=1 and ipAddress='$session{env}{REMOTE_ADDR}'))");
+ and userId<>'1') or (userId='1' and ipAddress='$session{env}{REMOTE_ADDR}'))");
return $hasVoted;
}
diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm
index 20f712b27..72ce88bcf 100644
--- a/lib/WebGUI/Asset/Wobject/Survey.pm
+++ b/lib/WebGUI/Asset/Wobject/Survey.pm
@@ -442,7 +442,7 @@ sub getResponseCount {
my $ipAddress = $self->getIp;
my $userId = $self->getUserId;
my ($count) = WebGUI::SQL->quickArray("select count(*) from Survey_response where Survey_id=".quote($self->get("Survey_id"))." and
- ((userId<>1 and userId=".quote($userId).") or ( userId=1 and ipAddress=".quote($ipAddress)."))");
+ ((userId<>'1' and userId=".quote($userId).") or ( userId='1' and ipAddress=".quote($ipAddress)."))");
return $count;
}
diff --git a/lib/WebGUI/Asset/Wobject/USS.pm b/lib/WebGUI/Asset/Wobject/USS.pm
index da435ae0c..5ea1fa736 100644
--- a/lib/WebGUI/Asset/Wobject/USS.pm
+++ b/lib/WebGUI/Asset/Wobject/USS.pm
@@ -318,7 +318,7 @@ sub view {
if ($constraints ne "") {
$constraints = "USS_submission.status='Approved' and ".$constraints;
} else {
- $constraints = "(USS_submission.status='Approved' or (USS_submission.userId=".quote($session{user}{userId})." and USS_submission.userId<>1)";
+ $constraints = "(USS_submission.status='Approved' or (USS_submission.userId=".quote($session{user}{userId})." and USS_submission.userId<>'1')";
if ($var{canModerate}) {
$constraints .= " or USS_submission.status='Pending'";
}
diff --git a/lib/WebGUI/Auth/LDAP.pm b/lib/WebGUI/Auth/LDAP.pm
index 0d04e530b..533a3ca2b 100644
--- a/lib/WebGUI/Auth/LDAP.pm
+++ b/lib/WebGUI/Auth/LDAP.pm
@@ -217,7 +217,7 @@ sub createAccountSave {
#Check that username is valid and not a duplicate in the system.
- $error .= $self->error if($self->validUsername($username));
+ $error .= $self->error if(!$self->validUsername($username));
#Validate profile data.
my ($profile, $temp, $warning) = WebGUI::Operation::Profile::validateProfileData();
$error .= $temp;
diff --git a/lib/WebGUI/DateTime.pm b/lib/WebGUI/DateTime.pm
index dc5700f62..471f7f0ef 100644
--- a/lib/WebGUI/DateTime.pm
+++ b/lib/WebGUI/DateTime.pm
@@ -241,7 +241,7 @@ A string representing the output format for the date. Defaults to '%z %Z'. You c
%m = A two digit month.
%M = A variable digit month.
%n = A two digit minute.
- %o = Offset from GMT represented as an integer.
+ %o = Offset from local time represented as an integer.
%O = Offset from GMT represented in four digit form with a sign. Example: -0600
%p = A lower-case am/pm.
%P = An upper-case AM/PM.
@@ -265,9 +265,11 @@ sub epochToHuman {
my ($year,$month,$day,$hour,$min,$sec) = epochToArray($temp);
$output = $_[1] || "%z %Z";
#---GMT Offsets
- $temp = $session{user}{timeOffset}*100;
- $temp = sprintf('%+05d',$temp);
- $output =~ s/\%O/$temp/g;
+ if ($output =~ /\%O/) {
+ $temp = $session{user}{timeOffset}*100;
+ $temp = sprintf("%+05d",Date::Manip::UnixDate("now","%z")+$temp);
+ $output =~ s/\%O/$temp/g;
+ }
$temp = $session{user}{timeOffset}+0;
$output =~ s/\%o/$temp/g;
#---dealing with percent symbol
diff --git a/lib/WebGUI/FormProcessor.pm b/lib/WebGUI/FormProcessor.pm
index 788598062..92aa50895 100644
--- a/lib/WebGUI/FormProcessor.pm
+++ b/lib/WebGUI/FormProcessor.pm
@@ -454,7 +454,7 @@ sub process {
$type = "text" if ($type eq "");
$value = &$type($name);
unless (defined $value) {
- $value = $default;
+ return $default;
}
if ($value =~ /^[\s]+$/) {
return undef;
diff --git a/lib/WebGUI/Forum/Post.pm b/lib/WebGUI/Forum/Post.pm
index 7d48fcfc8..c622eb566 100644
--- a/lib/WebGUI/Forum/Post.pm
+++ b/lib/WebGUI/Forum/Post.pm
@@ -214,7 +214,7 @@ sub hasRated {
return 1 if ($userId != 1 && $userId eq $self->get("userId")); # is poster
$ipAddress = $session{env}{REMOTE_ADDR} unless ($ipAddress);
my ($flag) = WebGUI::SQL->quickArray("select count(*) from forumPostRating where forumPostId="
- .quote($self->get("forumPostId"))." and ((userId=".quote($userId)." and userId<>1) or (userId=1 and
+ .quote($self->get("forumPostId"))." and ((userId=".quote($userId)." and userId<>1) or (userId='1' and
ipAddress=".quote($ipAddress)."))");
return $flag;
}
diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm
index 1c3b5adb2..40eeae387 100644
--- a/lib/WebGUI/Forum/UI.pm
+++ b/lib/WebGUI/Forum/UI.pm
@@ -1393,8 +1393,11 @@ The unique id of the post that was selected by the user in this thread.
sub getFlatThread {
my ($post, $thread, $forum, $caller, $currentPost) = @_;
- my (@post_loop, @posts);
- @posts = WebGUI::SQL->buildArray("SELECT forumPostId FROM forumPost WHERE forumThreadId=".quote($thread->get("forumThreadId"))." ORDER BY dateOfPost");
+ my (@post_loop, @posts, $OR);
+ unless ($post->getThread->getForum->isModerator) {
+ $OR = "OR status='denied' OR status='pending'";
+ }
+ @posts = WebGUI::SQL->buildArray("SELECT forumPostId FROM forumPost WHERE forumThreadId=".quote($thread->get("forumThreadId"))." AND NOT (status='deleted' $OR) ORDER BY dateOfPost");
foreach my $postId (@posts){
my $post = WebGUI::Forum::Post->new($postId);
push (@post_loop, getPostTemplateVars($post,$thread, $forum, $caller, {
@@ -1829,7 +1832,7 @@ sub www_postPreview {
$newPost->{_properties}->{userId} = $session{user}{userId};
$newPost->{_properties}->{username} = ($session{form}{visitorName} || $session{user}{alias});
$newPost->{_properties}->{dateOfPost} = WebGUI::DateTime::time();
-
+ my $forum = WebGUI::Forum->new($forumId);
my $var = getPostTemplateVars($newPost, WebGUI::Forum::Thread->new($threadId), WebGUI::Forum->new($forumId), $caller);
$var->{'newpost.header'} = WebGUI::International::get('Forum, Preview Heading');
@@ -1851,7 +1854,7 @@ sub www_postPreview {
$var->{'form.begin'} .= WebGUI::Form::hidden({name=>'forumOp', value=>"postSave"});
$var->{'form.submit'} = WebGUI::Form::submit();
$var->{'form.end'} = WebGUI::Form::formFooter();
- return WebGUI::Template::process(1,"Forum/PostPreview", $var);
+ return WebGUI::Template::process($forum->get("postPreviewTemplateId"),"Forum/PostPreview", $var);
}
diff --git a/lib/WebGUI/Group.pm b/lib/WebGUI/Group.pm
index ca039db67..fdb5eac55 100755
--- a/lib/WebGUI/Group.pm
+++ b/lib/WebGUI/Group.pm
@@ -349,7 +349,8 @@ The name of the group you wish to instanciate.
=cut
sub find {
- my ($groupId) = WebGUI::SQL->quickArray("select groupId from groups where groupName=".quote($_[1]));
+ my $name = shift;
+ my ($groupId) = WebGUI::SQL->quickArray("select groupId from groups where groupName=".quote($name));
return WebGUI::Group->new($groupId);
}
diff --git a/lib/WebGUI/Macro.pm b/lib/WebGUI/Macro.pm
index dbc35aa73..df6b090c8 100644
--- a/lib/WebGUI/Macro.pm
+++ b/lib/WebGUI/Macro.pm
@@ -161,6 +161,9 @@ sub process {
if ($@) {
WebGUI::ErrorHandler::warn("Processing failed on macro: $macro: ".$@);
} else {
+ if ($result =~ /\Q$macro/) {
+ $result = "Endless macro loop detected. Stopping recursion.";
+ }
$content =~ s/\Q$macro/$result/ges;
}
}
diff --git a/lib/WebGUI/Macro/SI_scaledImage.pm b/lib/WebGUI/Macro/SI_scaledImage.pm
index f89692ab3..4729d0b04 100644
--- a/lib/WebGUI/Macro/SI_scaledImage.pm
+++ b/lib/WebGUI/Macro/SI_scaledImage.pm
@@ -42,7 +42,7 @@ sub process {
my ($collateralIdent,$width,$height,$parameters) = WebGUI::Macro::getParams($_[0]);
my ($collateral,$url);
- if ($collateralIdent =~ /^\d+$/) {
+ if ($collateralIdent =~ /[\w|\-]{22}/) {
$collateral = WebGUI::Collateral->new($collateralIdent);
}
else {
diff --git a/lib/WebGUI/Macro/r_printable.pm b/lib/WebGUI/Macro/r_printable.pm
index 1790caa05..02cedfb1d 100644
--- a/lib/WebGUI/Macro/r_printable.pm
+++ b/lib/WebGUI/Macro/r_printable.pm
@@ -14,7 +14,7 @@ use strict;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Session;
-use WebGUI::Asset::Template;
+use WebGUI::Template;
use WebGUI::URL;
use WebGUI::Utility;
@@ -28,7 +28,10 @@ sub process {
}
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},$append);
if ($param[1] ne "") {
- $temp = WebGUI::URL::append($temp,'styleId='.$param[1]);
+ ($styleId) = WebGUI::Template::getIdByName($param[1],"style");
+ if ($styleId != 0) {
+ $temp = WebGUI::URL::append($temp,'styleId='.$styleId);
+ }
}
if ($param[0] ne "linkonly") {
my %var;
@@ -38,11 +41,7 @@ sub process {
} else {
$var{'printable.text'} = WebGUI::International::get(53);
}
- if ($param[2]) {
- $temp = WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
- } else {
- $temp = WebGUI::Asset::Template->new("PBtmpl0000000000000109")->process(\%var);
- }
+ $temp = WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/r_printable"), "Macro/r_printable", \%var);
}
return $temp;
}
diff --git a/lib/WebGUI/Mail.pm b/lib/WebGUI/Mail.pm
index 059259af5..dcb648d3e 100644
--- a/lib/WebGUI/Mail.pm
+++ b/lib/WebGUI/Mail.pm
@@ -92,6 +92,7 @@ sub send {
$message .= "BCC: $_[5]\n" if ($_[5]);
$message .= "Subject: ".$_[1]."\n";
$message .= "Date: ".WebGUI::DateTime::epochToHuman("","%W, %d %C %y %j:%n:%s %O")."\n";
+ $message .= "Content-Type: text/plain; charset=UTF-8","charset")."\n";
$message .= "\n";
$message = WebGUI::Macro::process($message);
#body
diff --git a/lib/WebGUI/MessageLog.pm b/lib/WebGUI/MessageLog.pm
index 06d4b168b..1249305c9 100644
--- a/lib/WebGUI/MessageLog.pm
+++ b/lib/WebGUI/MessageLog.pm
@@ -124,6 +124,9 @@ sub addEntry {
unless ($url =~ /^http/ || !defined $url) {
$url = WebGUI::URL::getSiteURL().$url;
}
+ unless ($url =~ /op=/ || !defined $url) {
+ $url = WebGUI::URL::append($url, "op=viewMessageLogMessage");
+ }
$status = $_[5];
$from = $_[6];
if ($groupId ne "") {
@@ -189,6 +192,9 @@ sub addInternationalizedEntry {
unless ($url =~ /^http/ || !defined $url) {
$url = WebGUI::URL::getSiteURL().$url;
}
+ unless ($url =~ /op=/ || !defined $url) {
+ $url = WebGUI::URL::append($url, "op=viewMessageLogMessage");
+ }
$internationalId = $_[3];
$namespace = $_[4] || "WebGUI";
$status = $_[5] || 'notice';
diff --git a/lib/WebGUI/Operation/Profile.pm b/lib/WebGUI/Operation/Profile.pm
index 285c6a17b..f4c5b4cc3 100644
--- a/lib/WebGUI/Operation/Profile.pm
+++ b/lib/WebGUI/Operation/Profile.pm
@@ -114,7 +114,7 @@ sub validateProfileData {
$a = WebGUI::SQL->read("select * from userProfileField,userProfileCategory where userProfileField.profileCategoryId=userProfileCategory.profileCategoryId
and userProfileCategory.editable=1 and userProfileField.editable=1 order by userProfileCategory.sequenceNumber,userProfileField.sequenceNumber");
while (%field = $a->hash) {
- $data{$field{fieldName}} = WebGUI::Macro::negate(WebGUI::FormProcessor::process($field{fieldName},$field{dataType}));
+ $data{$field{fieldName}} = WebGUI::Macro::negate(WebGUI::FormProcessor::process($field{fieldName},$field{dataType},""));
if ($field{required} && $data{$field{fieldName}} eq "") {
$error .= ''.(eval $field{fieldLabel}).' '.WebGUI::International::get(451);
}elsif($field{fieldName} eq "email" && isDuplicateEmail($data{$field{fieldName}})){
@@ -150,8 +150,13 @@ sub www_editProfile {
$label = eval $data->{fieldLabel};
$default = eval $data->{dataDefault};
- if ($method eq "selectList") {
- $values = eval $data->{dataValues};
+ if ($method eq "selectList" || $method eq "checkList" || $method eq "radioList") {
+ $values = eval $data->{dataValues};
+ my $orderedValues = {};
+ tie %{$orderedValues}, 'Tie::IxHash';
+ foreach my $ov (sort keys %{$values}) {
+ $orderedValues->{$ov} = $values->{$ov};
+ }
# note: this big if statement doesn't look elegant, but doing regular ORs caused problems with the array reference.
if ($session{form}{$data->{fieldName}}) {
$default = [$session{form}{$data->{fieldName}}];
diff --git a/lib/WebGUI/Operation/ProfileSettings.pm b/lib/WebGUI/Operation/ProfileSettings.pm
index 26f25147b..bbff3f0aa 100644
--- a/lib/WebGUI/Operation/ProfileSettings.pm
+++ b/lib/WebGUI/Operation/ProfileSettings.pm
@@ -74,7 +74,7 @@ sub www_deleteProfileCategoryConfirm {
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::vitalComponent() if ($session{form}{cid} < 1000 && $session{form}{cid} > 0);
WebGUI::SQL->write("delete from userProfileCategory where profileCategoryId=".quote($session{form}{cid}));
- WebGUI::SQL->write("update userProfileField set profileCategoryId=1 where profileCategoryId=".quote($session{form}{cid}));
+ WebGUI::SQL->write("update userProfileField set profileCategoryId='1' where profileCategoryId=".quote($session{form}{cid}));
return www_editProfileSettings();
}
diff --git a/lib/WebGUI/Operation/Statistics.pm b/lib/WebGUI/Operation/Statistics.pm
index 436ce36ba..2690b7f98 100644
--- a/lib/WebGUI/Operation/Statistics.pm
+++ b/lib/WebGUI/Operation/Statistics.pm
@@ -94,13 +94,13 @@ sub www_viewStatistics {
$version = ''.$version.'';
}
$output .= '| '.$version.' |
';
- ($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId<>3");
+ ($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId<>'3'");
$output .= '| '.$data.' |
';
- ($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId=0");
+ ($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId='0'");
$output .= '| '.$data.' |
';
- ($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId=5");
+ ($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId='5'");
$output .= '| '.$data.' |
';
- ($data) = WebGUI::SQL->quickArray("select count(*) from wobject where pageId<>3");
+ ($data) = WebGUI::SQL->quickArray("select count(*) from wobject where pageId<>'3'");
$output .= '| '.$data.' |
';
($data) = WebGUI::SQL->quickArray("select count(*) from template where namespace='style'");
$output .= '| '.$data.' |
';
diff --git a/lib/WebGUI/SQL.pm b/lib/WebGUI/SQL.pm
index 0c389b3f6..45a323e1a 100644
--- a/lib/WebGUI/SQL.pm
+++ b/lib/WebGUI/SQL.pm
@@ -173,7 +173,7 @@ Builds a hash of data from a series of rows.
=head3 sql
-An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by an underscore "_" to form a complex key.
+An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by a colon ":" to form a complex key.
=head3 dbh
@@ -187,7 +187,7 @@ sub buildHash {
$sth = WebGUI::SQL->read($_[1],$_[2]);
while (@data = $sth->array) {
my $value = pop @data;
- my $key = join("_",@data);
+ my $key = join(":",@data);
$hash{$key} = $value;
}
$sth->finish;
diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm
index 102fd5453..dfd4b536c 100644
--- a/lib/WebGUI/Storage.pm
+++ b/lib/WebGUI/Storage.pm
@@ -19,6 +19,7 @@ use File::Copy qw(cp);
use FileHandle;
use File::Path;
use POSIX;
+use Storable qw(nstore retrieve);
use strict;
use warnings;
use WebGUI::ErrorHandler;
@@ -241,7 +242,8 @@ sub addFileFromHashref {
my $self = shift;
my $filename = WebGUI::URL::makeCompliant(shift);
my $hashref = shift;
- store $hashref, $self->getPath($filename) or $self->_addError("Couldn't create file ".$self->getPath($filename)." because ".$!);
+ bless $hashref;
+ nstore $hashref, $self->getPath($filename) or $self->_addError("Couldn't create file ".$self->getPath($filename)." because ".$!);
return $filename;
}
diff --git a/lib/WebGUI/Wobject/EventsCalendar.pm b/lib/WebGUI/Wobject/EventsCalendar.pm
index 13e8bf7ba..445fc3284 100644
--- a/lib/WebGUI/Wobject/EventsCalendar.pm
+++ b/lib/WebGUI/Wobject/EventsCalendar.pm
@@ -408,9 +408,9 @@ sub www_view {
} elsif ($_[0]->get("endMonth") eq "after6") {
$maxDate = WebGUI::DateTime::addToDate($minDate,0,6,0);
} elsif ($_[0]->get("endMonth") eq "after3") {
- $maxDate = WebGUI::DateTime::addToDate($minDate,0,3,0);
+ $maxDate = WebGUI::DateTime::addToDate($minDate,0,3,0);
} elsif ($_[0]->get("endMonth") eq "current") { # a hack that we need to get the default month to be end month. probably a better way to do it
- $maxDate = WebGUI::DateTime::addToDate($minDate,0,1,0);
+ $maxDate = WebGUI::DateTime::addToDate($minDate,0,1,0);
}
$maxDate = $maxDate || WebGUI::DateTime::time();
@@ -434,32 +434,28 @@ sub www_view {
# get event information
my $query = "select * from EventsCalendar_event where ";
$query .= " wobjectId=".quote($_[0]->get("wobjectId"))." and " unless ($_[0]->get("isMaster"));
- $query .= " (endDate>=$monthStart and endDate<=$monthEnd) and (startDate>=$monthStart and startDate<=$monthEnd) order by startDate,endDate";
+ $query .= " ((endDate>=$monthStart and endDate<=$monthEnd) or (startDate>=$monthStart and startDate<=$monthEnd)) order by startDate,endDate";
my %events;
my %previous;
my $sth = WebGUI::SQL->read($query,WebGUI::SQL->getSlave);
while (my $event = $sth->hashRef) {
my $eventLength = WebGUI::DateTime::getDaysInInterval($event->{startDate},$event->{endDate});
- my $startYear = epochToHuman($event->{startDate},"%y");
- my $startMonth = epochToHuman($event->{startDate},"%c");
- my $startDay = epochToHuman($event->{startDate},"%D");
- my $endYear = epochToHuman($event->{endDate},"%y");
- my $endMonth = epochToHuman($event->{endDate},"%c");
- my $endDay = epochToHuman($event->{endDate},"%D");
+ my ($startYear, $startMonth, $startDay, $startDate, $startTime) = split " ", WebGUI::DateTime::epochToHuman($event->{startDate}, "%y %c %D %z %Z");
+ my ($endYear, $endMonth, $endDay, $endDate, $endTime) = split " ", WebGUI::DateTime::epochToHuman($event->{endDate}, "%y %c %D %z %Z");
for (my $i=0; $i<=$eventLength; $i++) {
my @date = WebGUI::DateTime::epochToArray(WebGUI::DateTime::addToDate($event->{startDate},0,0,$i));
if ($date[1] == $thisMonthDate[1]) {
push(@{$events{$date[2]}}, {
description=>$event->{description},
name=>$event->{name},
- 'start.date.human'=>WebGUI::DateTime::epochToHuman($event->{startDate},"%z"),
- 'start.time.human'=>WebGUI::DateTime::epochToHuman($event->{startDate},"%Z"),
+ 'start.date.human'=>$startDate,
+ 'start.time.human'=>$startTime,
'start.date.epoch'=>$event->{startDate},
'start.year'=>$startYear,
'start.month'=>$startMonth,
'start.day'=>$startDay,
- 'end.date.human'=>WebGUI::DateTime::epochToHuman($event->{endDate},"%z"),
- 'end.time.human'=>WebGUI::DateTime::epochToHuman($event->{endDate},"%Z"),
+ 'end.date.human'=>$endDate,
+ 'end.time.human'=>$endTime,
'end.date.epoch'=>$event->{endDate},
'end.year'=>$endYear,
'end.month'=>$endMonth,
diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl
index f00b170f9..638084abc 100644
--- a/sbin/testEnvironment.pl
+++ b/sbin/testEnvironment.pl
@@ -377,10 +377,10 @@ $version = $response->content;
chomp $version;
if ($response->is_error) {
print "Couldn't connect to Plain Black Software. Check your connection and try again.\n";
-} elsif ($version eq $WebGUI::VERSION) {
+} elsif ($version eq $WebGUI::VERSION."-".$WebGUI::STATUS) {
print $version." OK\n";
} else {
- print "You are using ".$WebGUI::VERSION." and ".$version." is available.\n";
+ print "You are using ".$WebGUI::VERSION."-".$WebGUI::STATUS." and ".$version." is available.\n";
}