From 5f33a4a15da49f705ca9ea76b2a8444897da6e8c Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 24 Sep 2004 22:31:45 +0000 Subject: [PATCH] bugs fixed --- docs/changelog/6.x.x.txt | 7 +++++++ docs/upgrades/upgrade_6.2.4-6.2.5.sql | 3 ++- lib/WebGUI.pm | 2 +- lib/WebGUI/Macro/RootTitle.pm | 16 +++------------- lib/WebGUI/Operation/Collateral.pm | 4 ++-- lib/WebGUI/Operation/Page.pm | 8 ++++---- lib/WebGUI/Wobject/HttpProxy.pm | 1 - lib/WebGUI/Wobject/Survey.pm | 15 +++++++++++---- lib/WebGUI/i18n/English/Article.pm | 17 ++++++++++++++--- lib/WebGUI/i18n/English/Survey.pm | 6 ++++++ lib/WebGUI/i18n/English/WebGUI.pm | 10 +++++----- 11 files changed, 55 insertions(+), 34 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 2b66fd004..ac2c24d16 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -13,6 +13,13 @@ - Fixed a problem with the new export mechanism where it would just stop and not report an error if it ran into a problem with creating folders and files. + - bugfix [ 1033998 ] ^RootTitle does not work + - bugfix [ 1031987 ] no upgrade script in 6.2.4 + - bugfix [ 1030998 ] HTML Collateral Manager Issues (Harlan Barnes) + - Updated some of the template help. (Colin Kuskie) + - bugfix [ 1023800 ] USS - Read more + - bugfix [ 1033204 ] parentId empty when creating new root + - bugfix [ 998252 ] No Answers in Survey Causes Endless Loop 6.2.4 diff --git a/docs/upgrades/upgrade_6.2.4-6.2.5.sql b/docs/upgrades/upgrade_6.2.4-6.2.5.sql index 1ea0df9f1..acf958668 100644 --- a/docs/upgrades/upgrade_6.2.4-6.2.5.sql +++ b/docs/upgrades/upgrade_6.2.4-6.2.5.sql @@ -1,5 +1,6 @@ insert into webguiVersion values ('6.2.5','upgrade',unix_timestamp()); --- Fix HTMLArea 3 template bug / Len Kranendonk 20040924 update template set template='^JavaScript(\"/textFix.js\");\r\n \r\n\r\n^RawHeadTags(\r\n \r\n\r\n \r\n\r\n \r\n);\r\n\r\n \r\n\r\n \r\n\r\n ' where templateId=6 and namespace='richEditor'; +update page set parentId=0 where parentId is null; +update page set parentId=0 where parentId=''; diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 0661bf212..bb98a5a8e 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -37,7 +37,7 @@ sub _generatePage { pageId, pageTitle, wobjectId, wobjectFunction) values (".time().",".$session{user}{userId} .",".quote($session{user}{username}).", ".quote($session{env}{REMOTE_ADDR}).", ".quote($session{env}{HTTP_USER_AGENT}).", - ".quote($session{env}{HTTP_REFERER}).", ".$session{page}{pageId}.", + ".quote($session{env}{HTTP_REFERER}).", ".quote($session{page}{pageId}).", ".quote($session{page}{title}).", ".quote($session{form}{wid}).", ".quote($session{form}{func}).")"); } my $output = WebGUI::Style::process($content); diff --git a/lib/WebGUI/Macro/RootTitle.pm b/lib/WebGUI/Macro/RootTitle.pm index a04378c34..9a1992502 100644 --- a/lib/WebGUI/Macro/RootTitle.pm +++ b/lib/WebGUI/Macro/RootTitle.pm @@ -12,23 +12,13 @@ package WebGUI::Macro::RootTitle; use strict; use Tie::CPHash; -use WebGUI::Macro; +use WebGUI::Page; use WebGUI::Session; -use WebGUI::SQL; -use WebGUI::URL; #------------------------------------------------------------------- sub process { - my ($sth, %data, $output); - tie %data, 'Tie::CPHash'; - my $pageid = $_[0] || $session{page}{parentId}; - %data = WebGUI::SQL->quickHash("select pageId,parentId,title,urlizedTitle from page where pageId=".quote($pageId),WebGUI::SQL->getSlave); - if ($data{parentId} == 0) { - $output = $data{title} || $session{page}{title}; - } else { - $output = &process($data{parentId},$_[1]); - } - return $output; + my $root = WebGUI::Page->getWebGUIRoot; + return $root->get("title"); } diff --git a/lib/WebGUI/Operation/Collateral.pm b/lib/WebGUI/Operation/Collateral.pm index c9dc10fe7..f376636ce 100644 --- a/lib/WebGUI/Operation/Collateral.pm +++ b/lib/WebGUI/Operation/Collateral.pm @@ -527,7 +527,7 @@ sub www_htmlArealistCollateral { my $parent = $folderId; # push parent folders in array so it can be reversed unshift(@parents, $parent); - until($parent == 0) { + until($parent eq '0') { ($parent) = WebGUI::SQL->quickArray("select parentId from collateralFolder where collateralFolderId=".quote($parent)); unshift(@parents, $parent); } @@ -544,7 +544,7 @@ sub www_htmlArealistCollateral { } # Extend tree with closed folders in current folder $sth = WebGUI::SQL->read("select collateralFolderId, name, description from collateralFolder - where parentId=".quote($folderId)." and collateralFolderId<>0 order by name"); + where parentId=".quote($folderId)." and collateralFolderId <> '0' order by name"); while ($data = $sth->hashRef) { my ($itemsInFolder) = WebGUI::SQL->quickArray("select count(*) from collateral where collateralFolderId = ".quote($data->{collateralFolderId})); diff --git a/lib/WebGUI/Operation/Page.pm b/lib/WebGUI/Operation/Page.pm index bc8d1879a..e08b02059 100644 --- a/lib/WebGUI/Operation/Page.pm +++ b/lib/WebGUI/Operation/Page.pm @@ -543,17 +543,17 @@ sub www_editPageSave { if ($session{form}{pageId} eq "new") { $pageId = $session{form}{parentId}; } else { - $page = WebGUI::Page->getPage($session{form}{pageId}); $pageId = $session{form}{pageId}; } - return WebGUI::Privilege::insufficient() unless (WebGUI::Page::canEdit($pageId)); if ($session{form}{pageId} eq "new") { - $currentPage = WebGUI::Page->getPage($pageId); + $currentPage = WebGUI::Page->getPage($session{form}{parentId}); $page = $currentPage->add; + $page->set({parentId=>$session{form}{parentId}}); + } else { + $page = WebGUI::Page->getPage($session{form}{pageId}); } - $session{form}{title} = "no title" if ($session{form}{title} eq ""); $session{form}{menuTitle} = $session{form}{title} if ($session{form}{menuTitle} eq ""); my $url = $session{form}{urlizedTitle}; diff --git a/lib/WebGUI/Wobject/HttpProxy.pm b/lib/WebGUI/Wobject/HttpProxy.pm index f994dc9e2..d6e28db3d 100644 --- a/lib/WebGUI/Wobject/HttpProxy.pm +++ b/lib/WebGUI/Wobject/HttpProxy.pm @@ -212,7 +212,6 @@ sub www_view { $input_name =~ s/^HttpProxy_//; my $uploadFile = $session{cgi}->tmpFileName($session{form}{'HttpProxy_'.$input_name}); - if(-r $uploadFile) { # Found uploaded file @formUpload=($uploadFile, qq/$session{form}{'HttpProxy_'.$input_name}/); $formdata{$input_name}=\@formUpload; diff --git a/lib/WebGUI/Wobject/Survey.pm b/lib/WebGUI/Wobject/Survey.pm index e5578ff27..ab38dd51b 100644 --- a/lib/WebGUI/Wobject/Survey.pm +++ b/lib/WebGUI/Wobject/Survey.pm @@ -431,10 +431,17 @@ sub uiLevel { #------------------------------------------------------------------- sub www_deleteAnswer { - return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit); - return $_[0]->confirm(WebGUI::International::get(45,$_[0]->get("namespace")), - WebGUI::URL::page('func=deleteAnswerConfirm&wid='.$_[0]->get("wobjectId").'&aid=' - .$session{form}{aid}.'&qid='.$session{form}{qid})); + my $self = shift; + return WebGUI::Privilege::insufficient() unless ($self->canEdit); + my ($answerCount) = WebGUI::SQL->quickArray("select count(*) from Survey_answer where Survey_questionId=".quote($session{form}{qid})); + if ($answerCount > 1) { + return $self->confirm( + $self->i18n(45), + WebGUI::URL::page('func=deleteAnswerConfirm&wid='.$self->wid.'&aid='.$session{form}{aid}.'&qid='.$session{form}{qid}) + ); + } else { + return $self->i18n("cannot delete the last answer"); + } } #------------------------------------------------------------------- diff --git a/lib/WebGUI/i18n/English/Article.pm b/lib/WebGUI/i18n/English/Article.pm index 20517764b..d5e1b5c20 100644 --- a/lib/WebGUI/i18n/English/Article.pm +++ b/lib/WebGUI/i18n/English/Article.pm @@ -130,8 +130,12 @@ Checking this box will enable responses to your article much like Articles on Sl Articles have the special ability to change their template so that you can allow users to see different views of the article. You do this by creating a link with a URL like this (replace 999 with the template Id you wish to use):

<a href="<tmpl_var new.template>999">Read more...</a>

+description
+The paginated description. +

+ description.full
-The full description without any pagination. (For the paginated description use "description" instead.) +The full description without any pagination.

description.first.100words
@@ -204,11 +208,18 @@ The URL to the thumbnail for the attached image. The URL to the attached image.

+linkTitle
+The title of the link to display to the user. +

+ +linkURL
+The URL for the link to display to the user. +

+ post.label
The translated label to add a comment to this article.

- post.URL
The URL to add a comment to this article.

@@ -226,7 +237,7 @@ The URL to view the replies to this article.

|, - lastUpdated => 1082370724 + lastUpdated => 1095829149 }, '24' => { diff --git a/lib/WebGUI/i18n/English/Survey.pm b/lib/WebGUI/i18n/English/Survey.pm index 6b0e431a5..ead806faa 100644 --- a/lib/WebGUI/i18n/English/Survey.pm +++ b/lib/WebGUI/i18n/English/Survey.pm @@ -705,6 +705,12 @@ If you leave this set at its default, then you will add a question directly afte lastUpdated => 1033944535 }, + 'cannot delete the last answer' => { + message=>q|You cannot delete the last answer from a question. Every question must have at least one answer.|, + lastUpdated=>1083944535, + context=>q|This message is displayed when a user is trying to delete the last answer from a survey question.| + }, + }; 1; diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 8a13901bd..faf410395 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -3412,9 +3412,10 @@ be http://www.mysite.com/thisPage#94 '826' => { message => q|WebGUI has a powerful templating language built to give you maximum control over the layout of your content. The following is a list of the template language syntax. - +

NOTES:
+Both the template language and template variables are case-insensitive.

-NOTE: Please note that the words foo and bar are used below as placeholders for the actual variable names that you'll use. They are not part of the template language. +Please note that the words foo and bar are used below as placeholders for the actual variable names that you'll use. They are not part of the template language.

Variables
@@ -3481,9 +3482,8 @@ Loops come with special condition variables of their own. They are __FIRST__, __ </TMPL_LOOP> -

-NOTE:Both the template language and template variables are case-insensitive.|, - lastUpdated => 1038865669 +

|, + lastUpdated =>1095829149 }, '354' => {