more bug fixes

This commit is contained in:
JT Smith 2005-08-12 19:09:29 +00:00
parent 0f9064a8ab
commit 5c3f7d8ccd
3 changed files with 15 additions and 9 deletions

View file

@ -19,6 +19,12 @@ save you many hours of grief.
will not display your questions for editing in Admin mode.
You will need to put your questions loop inside of a section
loop. See the default view template for an example.
* If you have any SQL reports going against the asset table, note that
it has been split into two tables "asset" and "assetData" and
your SQL reports will need to change.
6.6.4
--------------------------------------------------------------------
* Please ensure you're running HTML::Template version 2.7, which

View file

@ -180,7 +180,7 @@ sub getNextThread {
unless (exists $self->{_next}) {
my $sortBy = $self->getParent->getValue("sortBy");
my ($id, $class, $version) = WebGUI::SQL->quickHashRef("
select asset.assetId,asset.className,assetData.revisionDate
select asset.assetId,asset.className,max(assetData.revisionDate)
from Thread
left join asset on asset.assetId=Thread.assetId
left join assetData on assetData.assetId=Thread.assetId and assetData.revisionDate=Thread.revisionDate
@ -218,7 +218,7 @@ sub getPreviousThread {
unless (exists $self->{_previous}) {
my $sortBy = $self->getParent->getValue("sortBy");
my ($id, $class, $version) = WebGUI::SQL->quickHashRef("
select asset.assetId,asset.className,assetData.revisionDate
select asset.assetId,asset.className,max(assetData.revisionDate)
from Thread
left join asset on asset.assetId=Thread.assetId
left join assetData on assetData.assetId=Thread.assetId and assetData.revisionDate=Thread.revisionDate
@ -233,7 +233,7 @@ sub getPreviousThread {
or (assetData.ownerUserId=".quote($session{user}{userId})." and assetData.ownerUserId<>'1')
)
group by assetData.assetId
order by ".$sortBy." desc ",WebGUI::SQL->getSlave);
order by ".$sortBy." desc, assetData.revisionDate desc ",WebGUI::SQL->getSlave);
$self->{_previous} = WebGUI::Asset::Post->new($id,$class,$version);
delete $self->{_previous} unless ($self->{_previous}->{_properties}{className} =~ /Thread/);
};
@ -625,7 +625,7 @@ sub view {
$var->{'unlock.url'} = $self->getUnlockUrl;
my $p = WebGUI::Paginator->new($self->getUrl,$self->getParent->get("postsPerPage"));
my $sql = "select asset.assetId, asset.className, assetData.revisionDate from asset
my $sql = "select asset.assetId, asset.className, max(assetData.revisionDate) from asset
left join assetData on assetData.assetId=asset.assetId
left join Post on Post.assetId=assetData.assetId and assetData.revisionDate=Post.revisionDate
where asset.lineage like ".quote($self->get("lineage").'%')

View file

@ -904,7 +904,7 @@ sub view {
$constraints .= " or assetData.status='pending'";
}
$constraints .= ")";
my $sql = "select asset.assetId,asset.className,assetData.revisionDate
my $sql = "select asset.assetId,asset.className,max(assetData.revisionDate)
from Thread
left join asset on Thread.assetId=asset.assetId
left join Post on Post.assetId=Thread.assetId and Thread.revisionDate = Post.revisionDate
@ -1031,7 +1031,7 @@ sub www_search {
}
# please note that the SQL generated here-in is not for the feint of heart, mind, or stomach
# this is for trained professionals only and should not be attempted at home
my $sql = "select asset.assetId, asset.className, assetData.revisionDate
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
@ -1131,7 +1131,7 @@ sub www_viewRSS {
<link>$encUrl</link>
<description>$encDescription</description>
~;
my $sth = WebGUI::SQL->read("select *
my $sth = WebGUI::SQL->read("select asset.assetId, asset.className, max(assetData.revisionDate)
from Thread
left join asset on Thread.assetId=asset.assetId
left join Post on Post.assetId=Thread.assetId and Thread.revisionDate=Post.revisionDate
@ -1143,8 +1143,8 @@ sub www_viewRSS {
group by assetData.assetId
order by ".$self->getValue("sortBy")." ".$self->getValue("sortOrder"));
my $i = 1;
while (my $data = $sth->hashRef) {
my $post = WebGUI::Asset::Wobject::Collaboration->newByPropertyHashRef($data);
while (my ($id, $class, $version) = $sth->hashRef) {
my $post = WebGUI::Asset::Wobject::Collaboration->new($id, $class, $version);
my $encUrl = _xml_encode(WebGUI::URL::getSiteURL().$post->getUrl);
my $encTitle = _xml_encode($post->get("title"));