From 8664a34f1ecd68d17a49a1c11844d4e23b77d948 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 18 Aug 2005 19:20:08 +0000 Subject: [PATCH] more bug fixes --- docs/changelog/6.x.x.txt | 3 +++ docs/gotcha.txt | 3 +++ lib/WebGUI/Asset/Wobject/Collaboration.pm | 3 +-- lib/WebGUI/Asset/Wobject/Layout.pm | 2 +- sbin/Hourly/ArchiveOldPosts.pm | 10 +++++----- sbin/Hourly/IndexedSearch_buildIndex.pm | 2 ++ sbin/Hourly/TrashExpiredContent.pm | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 0911f1fa1..d28dcb231 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -22,6 +22,9 @@ - Fixed a problem with the rich editor in Internet Explorer that caused it not to save new content. - fix [ 1261789 ] fixed(?) can't edit collaboration (Collaboration.pm) (andreasg) + - fix [ 1262239 ] Error when searching discussion + - fix [ 1253545 ] moving wobjects around in a Layout doesn't spawn revisions + - fix [ 1262991 ] runHourly fails on asset.assetData 6.7.0 diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 542b205b1..75a829fe6 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -24,6 +24,9 @@ save you many hours of grief. it has been split into two tables "asset" and "assetData" and your SQL reports will need to change. + * The indexed search asset has been disabled until 6.8 where it will + be entirely rewritten from the ground up. + 6.6.4 -------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 9d28f2704..bb4e2900e 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -1034,7 +1034,6 @@ sub www_search { my $sql = "select asset.assetId, asset.className, max(assetData.revisionDate) from asset left join assetData on assetData.assetId=asset.assetId - left join Thread on Thread.assetId=assetData.assetId and assetData.revisionDate = Thread.revisionDate left join Post on Post.assetId=assetData.assetId and assetData.revisionDate = Post.revisionDate where (asset.className='WebGUI::Asset::Post' or asset.className='WebGUI::Asset::Post::Thread') and asset.lineage like ".quote($self->get("lineage").'%')." @@ -1043,7 +1042,7 @@ sub www_search { assetData.status in ('approved','archived') or assetData.tagId=".quote($session{scratch}{versionTag}); $sql .= " or assetData.status='pending'" if ($self->canModerate); - $sql .= " or (asset.ownerUserId=".quote($session{user}{userId})." and asset.ownerUserId<>'1') + $sql .= " or (assetData.ownerUserId=".quote($session{user}{userId})." and assetData.ownerUserId<>'1') ) "; $sql .= " and ($all) " if ($all ne ""); $sql .= " and " if ($sql ne "" && $exactPhrase ne ""); diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 4a18a411a..59da3819d 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -204,7 +204,7 @@ sub www_edit { sub www_setContentPositions { my $self = shift; return WebGUI::Privilege::insufficient() unless ($self->canEdit); - $self->update({ + $self->addRevision({ contentPositions=>$session{form}{map} }); return "Map set: ".$session{form}{map}; diff --git a/sbin/Hourly/ArchiveOldPosts.pm b/sbin/Hourly/ArchiveOldPosts.pm index 7c22ef05a..abd669040 100644 --- a/sbin/Hourly/ArchiveOldPosts.pm +++ b/sbin/Hourly/ArchiveOldPosts.pm @@ -23,12 +23,12 @@ sub process { my $a = WebGUI::SQL->read("select asset.lineage,Collaboration.archiveAfter from Collaboration left join asset on Collaboration.assetId=asset.assetId"); while (my ($lineage, $archiveAfter) = $a->array) { my $archiveDate = $epoch - $archiveAfter; - my $sql = "select * from Post left join asset on Post.assetId=asset.assetId left join Thread on Thread.assetId=Post.assetId - where Post.dateUpdated<$archiveDate and Post.status='approved' and asset.lineage like ".quote($lineage."%"); + my $sql = "select asset.assetId,asset.className, max(assetData.revisionDate) from Post left join asset on Post.assetId=asset.assetId + left join assetData on Post.assetId=assetData.assetId and assetData.revisionDate=Post.revisionDate + where Post.dateUpdated<$archiveDate and assetData.status='approved' and asset.lineage like ".quote($lineage."%")." group by asset.assetId"; my $b = WebGUI::SQL->read($sql); - while (my $properties = $b->hashRef) { - my $post = WebGUI::Asset::Post->newByPropertyHashRef($properties); - $post->setStatusArchived; + while (my ($id, $class, $version) = $b->array) { + WebGUI::Asset::Post->new($id,$class,$version)->setStatusArchived; } $b->finish; } diff --git a/sbin/Hourly/IndexedSearch_buildIndex.pm b/sbin/Hourly/IndexedSearch_buildIndex.pm index 437aef382..aaa3e1803 100644 --- a/sbin/Hourly/IndexedSearch_buildIndex.pm +++ b/sbin/Hourly/IndexedSearch_buildIndex.pm @@ -22,6 +22,8 @@ use WebGUI::Asset::Wobject::IndexedSearch::Search; #------------------------------------------------------------------- sub process { + #disabled until 6.8 + return ""; my $indexName = 'IndexedSearch_default'; my $htmlFilter = 'all'; my $stopList = 'none'; diff --git a/sbin/Hourly/TrashExpiredContent.pm b/sbin/Hourly/TrashExpiredContent.pm index 4d370f0da..0784bab11 100644 --- a/sbin/Hourly/TrashExpiredContent.pm +++ b/sbin/Hourly/TrashExpiredContent.pm @@ -22,7 +22,7 @@ sub process { if ($offset ne "") { my $epoch = time()-(86400*$offset); my $sth = WebGUI::SQL->read("select asset.assetId,asset.className,max(assetData.revisionDate) from asset left join assetData on - asset.assetId=assetData.assetId where assetData.endDate<".$epoch." and assetData.status<>'pending' group by asset.assetData"); + asset.assetId=assetData.assetId where assetData.endDate<".$epoch." group by assetData.assetId"); while (my ($assetId, $class, $version) = $sth->array) { my $asset = WebGUI::Asset->new($assetId,$class,$version); $asset->trash;