From 39ff1ea964a90ec091146263f77bfcb998162e6e Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 14 Mar 2005 21:55:01 +0000 Subject: [PATCH] bunch of bug fixes --- docs/changelog/6.x.x.txt | 9 +++++++ docs/previousVersion.sql | 9 +++---- docs/upgrades/upgrade_6.2.11-6.3.0.sql | 2 +- lib/WebGUI/Asset.pm | 31 ++++++++++++++--------- lib/WebGUI/Asset/Post/Thread.pm | 28 +++++++++++++++++++- lib/WebGUI/Asset/Wobject/Collaboration.pm | 5 ++-- 6 files changed, 61 insertions(+), 23 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index e2ac118f9..fdb6458e6 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -11,6 +11,15 @@ - fix [ 1157311 ] Edit User Profile fails on Windows/Firefox - fix [ 1160623 ] Redirect Incorrect- 6.2.11 - fix [ 1161455 ] New Content >> Data Form + - fixed a loop bug in the 6.3.0 upgrade that could cause pages to be upgraded + twice, which would kill the upgrade script + - fix [ 1158983 ] 6.4.0 demo Setting Asset rank crashes WebGUI + - fix [ 1160229 ] Couldn't call method www_search + - fix [ 1153154 ] 6.3 beta Add function doesn't use WYSIWYG + - fix [ 1157205 ] default content (in create.sql) outdated + - fix [ 1028595 ] Denial of Service WebGUI (e.g. forum wobject) + - fix [ 1157229 ] Not Found Page + - fix [ 1157198 ] selecting content profiling sends you back to admin console 6.5.0 diff --git a/docs/previousVersion.sql b/docs/previousVersion.sql index ce74f40e4..9fbe974d8 100644 --- a/docs/previousVersion.sql +++ b/docs/previousVersion.sql @@ -1156,7 +1156,6 @@ INSERT INTO Layout VALUES ('8Bb8gu-me2mhL3ljFyiWLg','PBtmpl0000000000000054','DC INSERT INTO Layout VALUES ('2TqQc4OISddWCZmRY1_m8A','PBtmpl0000000000000054','fK-HMSboA3uu0c1KYkYspA'); INSERT INTO Layout VALUES ('Swf6L8poXKc7hUaNPkBevw','PBtmpl0000000000000054','Szs5eev3OMssmnsyLRZmWA'); INSERT INTO Layout VALUES ('x3OFY6OJh_qsXkZfPwug4A','PBtmpl0000000000000054','pJd5TLAjfWMVXD6sCRLwUg'); -INSERT INTO Layout VALUES ('3PC6Hr5aKyrenApENNEUsQ','PBtmpl0000000000000054',''); -- -- Table structure for table `MessageBoard` @@ -1308,7 +1307,7 @@ CREATE TABLE Post ( INSERT INTO Post VALUES ('pSygeMG7bSL1Za0SNqfUbw','pSygeMG7bSL1Za0SNqfUbw',1076705448,1076706084,'Admin',' Our website contains all of the different methods for reaching us. Our friendly staff will be happy to assist you in any way possible.\r\n\r\n','approved',2,'html','http://www.plainblack.com/contact_us','0',NULL,NULL,NULL,NULL,0); -INSERT INTO Post VALUES ('mdIaXozmVNE_Rga2BY0mxA','mdIaXozmVNE_Rga2BY0mxA',1076705448,1076706084,'Admin','Ruling WebGUI is the definitive guide to everything WebGUI related. It has been compiled by the experts at Plain Black Software and covers almost all aspects of WebGUI. When you purchase Ruling WebGUI, you will receive updates to this great manual for one full year.','approved',0,'html','http://www.plainblack.com/store/rwg','0',NULL,NULL,NULL,NULL,0); +INSERT INTO Post VALUES ('mdIaXozmVNE_Rga2BY0mxA','mdIaXozmVNE_Rga2BY0mxA',1076705448,1076706084,'Admin','Ruling WebGUI is the definitive guide to everything WebGUI related. It has been compiled by the experts at Plain Black and covers almost all aspects of WebGUI. When you purchase Ruling WebGUI, you will receive updates to this great manual for one full year.','approved',0,'html','http://www.plainblack.com/store/rwg','0',NULL,NULL,NULL,NULL,0); INSERT INTO Post VALUES ('9kDcFufTKbMTkeAHyP36fw','9kDcFufTKbMTkeAHyP36fw',1076705448,1076706084,'Admin','The WebGUI Support Center is there to help you when you get stuck. With a system as large as WebGUI, you\'ll likely have some questions, and our courteous and knowlegable staff is available to answer those questions. And best of all, you get Ruling WebGUI free when you sign up for the Support Center.\r\n\r\n','approved',0,'html','http://www.plainblack.com/store/support','0',NULL,NULL,NULL,NULL,0); INSERT INTO Post VALUES ('5Y8eOI2u_HOvkzrRuLdz1g','5Y8eOI2u_HOvkzrRuLdz1g',1076705448,1076706084,'Admin','We provide professional hosting services for you so you don\'t have to go through the trouble of finding a hoster who likely won\'t know what to do with WebGUI anyway.','approved',0,'html','http://www.plainblack.com/store/hosting','0',NULL,NULL,NULL,NULL,0); INSERT INTO Post VALUES ('ImmYJRWOPFedzI4Bg1k6GA','ImmYJRWOPFedzI4Bg1k6GA',1076705448,1076706084,'Admin','Let Plain Black\'s design team build you a professional looking design. Our award-winning designers can get you the look you need on time and on budget, every time.','approved',0,'html','http://www.plainblack.com/design','0',NULL,NULL,NULL,NULL,0); @@ -1767,7 +1766,7 @@ INSERT INTO asset VALUES ('x_WjMvFmilhX-jvZuIpinw','_iHetEvMQUOoxS-T2CM0sQ','000 INSERT INTO asset VALUES ('8Bb8gu-me2mhL3ljFyiWLg','68sKwDgf9cGH58-NZcU4lg','000001000002000004','published','WebGUI::Asset::Wobject::Layout','What should you do next?','Your Next Step','your_next_step',946710000,2082783600,'3','7','3','',0,0,0,0,575,0,NULL,0,'',0); INSERT INTO asset VALUES ('DC1etlIaBRQitXnchZKvUw','8Bb8gu-me2mhL3ljFyiWLg','000001000002000004000001','published','WebGUI::Asset::Wobject::Collaboration','Your Next Step','Your Next Step','your_next_step/your_next_step',946710000,2082783600,'3','7','3',NULL,0,1,0,0,563,1109194990,NULL,0,NULL,0); INSERT INTO asset VALUES ('pSygeMG7bSL1Za0SNqfUbw','DC1etlIaBRQitXnchZKvUw','000001000002000004000001000001','published','WebGUI::Asset::Post::Thread','Talk to the Experts','Talk to the Experts','talk_to_the_experts',946710000,2114406000,'3','7','3',' Our website contains all of the different methods for reaching us. Our friendly staff will be happy to assist you in any way possible.\r',0,1,0,0,809,1109194990,NULL,0,NULL,0); -INSERT INTO asset VALUES ('mdIaXozmVNE_Rga2BY0mxA','DC1etlIaBRQitXnchZKvUw','000001000002000004000001000002','published','WebGUI::Asset::Post::Thread','Get the Manual','Get the Manual','get_the_manual',946710000,2114406000,'3','7','3','Ruling WebGUI is the definitive guide to everything WebGUI related. It has been compiled by the experts at Plain Black Software and covers almost all aspects of WebGUI. When you purchase Ruling WebGUI, you will receive updates to this great manual for one full year.',0,1,0,0,359,0,NULL,0,NULL,0); +INSERT INTO asset VALUES ('mdIaXozmVNE_Rga2BY0mxA','DC1etlIaBRQitXnchZKvUw','000001000002000004000001000002','published','WebGUI::Asset::Post::Thread','Get the Manual','Get the Manual','get_the_manual',946710000,2114406000,'3','7','3','Ruling WebGUI is the definitive guide to everything WebGUI related. It has been compiled by the experts at Plain Black and covers almost all aspects of WebGUI. When you purchase Ruling WebGUI, you will receive updates to this great manual for one full year.',0,1,0,0,359,0,NULL,0,NULL,0); INSERT INTO asset VALUES ('9kDcFufTKbMTkeAHyP36fw','DC1etlIaBRQitXnchZKvUw','000001000002000004000001000003','published','WebGUI::Asset::Post::Thread','Purchase Technical Support','Purchase Technical Support','purchase_technical_support',946710000,2114406000,'3','7','3','The WebGUI Support Center is there to help you when you get stuck. With a system as large as WebGUI, you\'ll likely have some questions, and our courteous and knowlegable staff is available to answer those questions. And best of all, you get Ruling WebGUI free when you sign up for the Support Center.\r',0,1,0,0,403,0,NULL,0,NULL,0); INSERT INTO asset VALUES ('5Y8eOI2u_HOvkzrRuLdz1g','DC1etlIaBRQitXnchZKvUw','000001000002000004000001000004','published','WebGUI::Asset::Post::Thread','Sign Up for Hosting','Sign Up for Hosting','sign_up_for_hosting',946710000,2114406000,'3','7','3','We provide professional hosting services for you so you don\'t have to go through the trouble of finding a hoster who likely won\'t know what to do with WebGUI anyway.',0,1,0,0,259,0,NULL,0,NULL,0); INSERT INTO asset VALUES ('ImmYJRWOPFedzI4Bg1k6GA','DC1etlIaBRQitXnchZKvUw','000001000002000004000001000005','published','WebGUI::Asset::Post::Thread','Look Great','Look Great','look_great',946710000,2114406000,'3','7','3','Let Plain Black\'s design team build you a professional looking design. Our award-winning designers can get you the look you need on time and on budget, every time.',0,1,0,0,260,0,NULL,0,NULL,0); @@ -1777,7 +1776,6 @@ INSERT INTO asset VALUES ('Swf6L8poXKc7hUaNPkBevw','68sKwDgf9cGH58-NZcU4lg','000 INSERT INTO asset VALUES ('Szs5eev3OMssmnsyLRZmWA','Swf6L8poXKc7hUaNPkBevw','000001000002000006000001','published','WebGUI::Asset::Wobject::DataForm','Tell A Friend','Tell A Friend','tell_a_friend/tell_a_friend',946710000,2082783600,'3','7','3',NULL,0,1,0,0,472,0,NULL,0,NULL,0); INSERT INTO asset VALUES ('x3OFY6OJh_qsXkZfPwug4A','68sKwDgf9cGH58-NZcU4lg','000001000002000007','published','WebGUI::Asset::Wobject::Layout','Site Map','Site Map','site_map',946710000,2082783600,'3','7','3','',0,0,0,0,548,0,NULL,0,'',0); INSERT INTO asset VALUES ('pJd5TLAjfWMVXD6sCRLwUg','x3OFY6OJh_qsXkZfPwug4A','000001000002000007000001','published','WebGUI::Asset::Wobject::Navigation','Site Map','Site Map','site_map/site_map',1001744792,1336444487,'3','7','3',NULL,0,1,0,0,440,0,NULL,0,NULL,0); -INSERT INTO asset VALUES ('3PC6Hr5aKyrenApENNEUsQ','PBasset000000000000001','000001000003','published','WebGUI::Asset::Wobject::Layout','Packages','Packages','packages',946710000,2082783600,'3','6','6',NULL,0,1,0,0,543,0,NULL,0,'',0); INSERT INTO asset VALUES ('Wmjn6I1fe9DKhiIR39YC0g','PBasset000000000000002','000001000001000001','published','WebGUI::Asset::Wobject::Folder','Navigation Configurations','Navigation Configurations','navigation_configurations',997995720,9223372036854775807,'3','4','4',NULL,0,1,0,0,0,1109194981,NULL,0,NULL,0); INSERT INTO asset VALUES ('PBnav00000000000000001','Wmjn6I1fe9DKhiIR39YC0g','000001000001000001000001','published','WebGUI::Asset::Wobject::Navigation','crumbTrail','crumbTrail','crumbtrail',997995720,9223372036854775807,'3','7','4',NULL,0,1,0,0,516,1109194981,NULL,0,NULL,0); INSERT INTO asset VALUES ('PBnav00000000000000014','Wmjn6I1fe9DKhiIR39YC0g','000001000001000001000002','published','WebGUI::Asset::Wobject::Navigation','FlexMenu','FlexMenu','flexmenu',997995720,9223372036854775807,'3','7','4',NULL,0,1,0,0,498,1109194981,NULL,0,NULL,0); @@ -2956,7 +2954,7 @@ CREATE TABLE wobject ( INSERT INTO wobject VALUES (1,'Welcome to WebGUI. This is web done right.\n

\nWebGUI is a user-friendly web site management system made by Plain Black. It is designed to be easy to use for the average business user, but powerful enough to satisfy the needs of a large enterprise.\n

\nThere are thousands of small and large businesses, schools, universities, governments, clubs, projects, communities, and individuals using WebGUI all over the world today. A brief list of some of them can be found here. There\'s no reason your site shouldn\'t be on that list.

','TKzUMeIxRLrZ3NAEez6CXQ','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); INSERT INTO wobject VALUES (1,'\n\n\n
\n\n
Easy to Use
\n
If you can use a web browser, then you can manage a web site with WebGUI. WebGUI\'s unique WYSIWYG inline content editing interface ensures that you know where you are and what your content will look like while you\'re editing. In addition, you don\'t need to install and learn any complicated programs, you can edit everything with your trusty web browser.
\n
\n\n
Flexible Designs
\n
WebGUI\'s powerful templating system ensures that no two WebGUI sites ever need to look the same. You\'re not restricted in how your content is laid out or how your navigation functions.
\n
\n\n
Work Faster
\n
Though there is some pretty cool technology behind the scenes that makes WebGUI work, our first concern has always been usability and not technology. After all if it\'s not useful, why use it? With that in mind WebGUI has all kinds of wizards, short cuts, online help, and other aids to help you work faster.
\n
\n\n
Localized Content
\n
With WebGUI there\'s no need to limit yourself to one language or timezone. It\'s a snap to build a multi-lingual site with WebGUI. In fact, even WebGUI\'s built in functions and online help have been translated to more than 15 languages. User\'s can also adjust their local settings for dates, times, and other localized oddities.
\n
\n\n
Pluggable By Design
\n
When Plain Black created WebGUI we knew we wouldn\'t be able to think of everything you want to use WebGUI for, so we made most of WebGUI\'s functions pluggable. This allows you to add new features to WebGUI and still be able to upgrade the core system without a fuss.
\n\n
','sWVXMZGibxHe2Ekj1DCldA','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); -INSERT INTO wobject VALUES (0,'If you\'re reading this message it means that you\'ve got WebGUI up and running. Good job! The installation is not trivial.\n\n

\n \nIn order to do anything useful with your new installation you\'ll need to log in as the default administrator account. Follow these steps to get started:\n\n

\n\n

    \n
  1. Click here to log in. (username: Admin password: 123qwe)\n
  2. Click here to turn the administrative interface on.\n
\n
\nNOTE: You could have also done these steps using the block at the top of this page.\n
\n\n

\n\nNow that you\'re in as the administrator, you should change your password so no one else can log in and mess with your site. You might also want to create another account for yourself with Administrative privileges in case you can\'t log in with the Admin account for some reason.\n\n

\n \nYou\'ll now notice little buttons and menus on all the pages in your site. These controls help you administer your site. The \"Add content\" menu lets you add new content to your pages as well as paste content from the clipboard. The \"Administrative functions\" menu let\'s you control users and groups as well as many other admin settings. The little toolbars help you manipulate the content in your pages.\n\n\n

\n\nFor more information about how to administer WebGUI consider getting a copy of Ruling WebGUI. Plain Black Software also provides several Support Programs for WebGUI if you run into trouble.\n\n

\n \nEnjoy your new WebGUI site!','x_WjMvFmilhX-jvZuIpinw','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); +INSERT INTO wobject VALUES (0,'If you\'re reading this message it means that you\'ve got WebGUI up and running. Good job! The installation is not trivial.\n\n

\n \nIn order to do anything useful with your new installation you\'ll need to log in as the default administrator account. Follow these steps to get started:\n\n

\n\n

    \n
  1. Click here to log in. (You specified the username and password when you first visited your new WebGUI site.)\n
  2. Click here to turn the administrative interface on.\n
\n
\nNOTE: You could have also done these steps using the block at the top of this page.\n
\n\n

\n\n You might want to create another account for yourself with Administrative privileges in case you can\'t log in with the Admin account for some reason.\n\n

\n \nYou\'ll now notice little buttons and menus on all the pages in your site. These controls help you administer your site. The \"Add content\" menu lets you add new content to your pages as well as paste content from the clipboard. The \"Administrative functions\" menu let\'s you control users and groups as well as many other admin settings. The little toolbars help you manipulate the content in your pages.\n\n\n

\n\nFor more information about how to administer WebGUI consider getting a copy of Ruling WebGUI. Plain Black also provides several Support Programs for WebGUI if you run into trouble.\n\n

\n \nEnjoy your new WebGUI site!','x_WjMvFmilhX-jvZuIpinw','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); INSERT INTO wobject VALUES (0,' To learn more about WebGUI and how you can best implement WebGUI in your organization, please see the choices below.\n\n','DC1etlIaBRQitXnchZKvUw','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); INSERT INTO wobject VALUES (0,'This is the latest news from Plain Black and WebGUI pulled directly from the site every hour.','fK-HMSboA3uu0c1KYkYspA','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); INSERT INTO wobject VALUES (0,'Tell a friend about WebGUI.','Szs5eev3OMssmnsyLRZmWA','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); @@ -2967,7 +2965,6 @@ INSERT INTO wobject VALUES (0,NULL,'8Bb8gu-me2mhL3ljFyiWLg','B1bNjWVtzSjsvGZh9lP INSERT INTO wobject VALUES (0,NULL,'2TqQc4OISddWCZmRY1_m8A','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); INSERT INTO wobject VALUES (0,NULL,'Swf6L8poXKc7hUaNPkBevw','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); INSERT INTO wobject VALUES (0,NULL,'x3OFY6OJh_qsXkZfPwug4A','B1bNjWVtzSjsvGZh9lPz_A','PBtmpl0000000000000111',60,600); -INSERT INTO wobject VALUES (0,NULL,'3PC6Hr5aKyrenApENNEUsQ','','PBtmpl0000000000000111',60,600); INSERT INTO wobject VALUES (1,NULL,'PBasset000000000000002','PBtmpl0000000000000060','PBtmpl0000000000000111',60,3600); INSERT INTO wobject VALUES (1,NULL,'Wmjn6I1fe9DKhiIR39YC0g','PBtmpl0000000000000060','PBtmpl0000000000000111',60,3600); INSERT INTO wobject VALUES (0,NULL,'PBnav00000000000000001','PBtmpl0000000000000060','PBtmpl0000000000000111',60,3600); diff --git a/docs/upgrades/upgrade_6.2.11-6.3.0.sql b/docs/upgrades/upgrade_6.2.11-6.3.0.sql index 203a93f94..fb354e1ba 100644 --- a/docs/upgrades/upgrade_6.2.11-6.3.0.sql +++ b/docs/upgrades/upgrade_6.2.11-6.3.0.sql @@ -334,4 +334,4 @@ update template set template='\">\r\ngetId); $sql .= " where f.fieldId = ".quote($fieldId) if ($fieldId); $sql .= " order by f.fieldName"; - my $sth = WebGUI::SQL->read($sql); - while( my $h = $sth->hashRef) { - foreach(keys %$h) { - $hash{$h->{fieldId}}{$_} = $h->{$_}; + if ($fieldId) { + return WebGUI::SQL->quickHashRef($sql); + } else { + tie my %hash, 'Tie::IxHash'; + my $sth = WebGUI::SQL->read($sql); + while( my $h = $sth->hashRef) { + foreach(keys %$h) { + $hash{$h->{fieldId}}{$_} = $h->{$_}; + } } + $sth->finish; + return \%hash; } - $sth->finish; - return \%hash; } #------------------------------------------------------------------- @@ -1814,6 +1818,8 @@ sub newByUrl { } if ($asset->{assetId} ne "" || $asset->{className} ne "") { return WebGUI::Asset->newByDynamicClass($asset->{assetId}, $asset->{className}); + } else { + return $class->newByDynamicClass($session{setting}{notFoundPage}); } } return $class->newByDynamicClass($session{setting}{defaultPage}); @@ -2527,11 +2533,11 @@ Returns a rendered page to edit MetaData. Will return an insufficient Privilege sub www_editMetaDataField { my $self = shift; - my $ac = WebGUI::AdminConsole->new("content profiling"); + my $ac = WebGUI::AdminConsole->new("contentProfiling"); return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4)); my $fieldInfo; if($session{form}{fid} && $session{form}{fid} ne "new") { - $fieldInfo = WebGUI::MetaData::getField($session{form}{fid}); + $fieldInfo = $self->getMetaDataFields($session{form}{fid}); } my $fid = $session{form}{fid} || "new"; my $f = WebGUI::HTMLForm->new(-action=>$self->getUrl); @@ -3095,16 +3101,17 @@ Returns an AdminConsole to deal with MetaDataFields. If isInGroup(4) is False, r sub www_manageMetaData { my $self = shift; - my $ac = WebGUI::AdminConsole->new("content profiling"); + my $ac = WebGUI::AdminConsole->new("contentProfiling"); return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4)); + $ac->addSubmenuItem($self->getUrl('func=editMetaDataField'), WebGUI::International::get("Add new field","Asset"),"Asset"); my $output; my $fields = $self->getMetaDataFields(); foreach my $fieldId (keys %{$fields}) { $output .= deleteIcon("func=deleteMetaDataField&fid=".$fieldId,$self->getUrl,WebGUI::International::get('deleteConfirm','Asset')); $output .= editIcon("func=editMetaDataField&fid=".$fieldId,$self->getUrl); - $output .= "".$fields->{$fieldId}{fieldName}."
"; + $output .= " ".$fields->{$fieldId}{fieldName}."
"; } - $ac->setHelp("metadata manage"); + $ac->setHelp("metadata manage","Asset"); return $ac->render($output); } diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index ff6b09f82..08aa78a71 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -729,7 +729,33 @@ sub www_unsubscribe { sub www_view { my $self = shift; return WebGUI::Privilege::noAccess() unless $self->canView; - return $self->getParent->processStyle($self->view); + my $cache; + my $output; + my $useCache = ( + $session{form}{op} eq "" && + $session{form}{func} eq "" && + $session{form}{layout} eq "" && + ( + ( $self->getParent->get("cacheTimeout") > 10 && $session{user}{userId} ne '1') || + ( $self->getParent->get("cacheTimeoutVisitor") > 10 && $session{user}{userId} eq '1') + ) && + not $session{var}{adminOn} + ); + if ($useCache) { + $cache = WebGUI::Cache->new("cspost_".$self->getId."_".$session{user}{userId}); + $output = $cache->get; + } + unless ($output) { + $output = $self->getParent->processStyle($self->view); + my $ttl; + if ($session{user}{userId} eq '1') { + $ttl = $self->getParent->get("cacheTimeoutVisitor"); + } else { + $ttl = $self->getParent->get("cacheTimeout"); + } + $cache->set($output, $ttl) if ($useCache); + } + return $output; } diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 2a3105e8b..a77e2f44a 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -972,9 +972,8 @@ sub www_search { Post.status in ('approved','archived')"; $sql .= " or Post.status='pending'" if ($self->canModerate); $sql .= " or (asset.ownerUserId=".quote($session{user}{userId})." and asset.ownerUserId<>'1') - ) - and "; - $sql .= "($all) " if ($all ne ""); + ) "; + $sql .= " and ($all) " if ($all ne ""); $sql .= " and " if ($sql ne "" && $exactPhrase ne ""); $sql .= " ($exactPhrase) " if ($exactPhrase ne ""); $sql .= " and " if ($sql ne "" && $atLeastOne ne "");