From 518d820a5e6b5c2e3aa4d49eb1163c5ac1aebf92 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Fri, 1 Sep 2006 14:43:16 +0000 Subject: [PATCH] fixed a search indexer problem and a tabs.css conflict with tinymce --- docs/changelog/7.x.x.txt | 2 ++ docs/upgrades/upgrade_7.0.6-7.0.7.pl | 14 ++++++++------ lib/WebGUI/Search.pm | 8 +++++--- lib/WebGUI/Search/Index.pm | 4 ++-- www/extras/tabs/tabs.css | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index bbcdd9009..713b598be 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -36,6 +36,8 @@ - fix: JavaScript race condition in dashlet prefs form - fix: caching problem with overrides in dashlets - fix: CS pagination does not work for visitors + - fixed a problem in the search indexer and made the tabform css compatible + with tinymce. (Martin Kamerbeek / Procolix) 7.0.6 - fix: Error in DateTime.pm diff --git a/docs/upgrades/upgrade_7.0.6-7.0.7.pl b/docs/upgrades/upgrade_7.0.6-7.0.7.pl index c4e42aea6..3666b635d 100644 --- a/docs/upgrades/upgrade_7.0.6-7.0.7.pl +++ b/docs/upgrades/upgrade_7.0.6-7.0.7.pl @@ -21,16 +21,18 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +dropLineageInAssetIndex($session); finish($session); # this line required -##------------------------------------------------- -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet); -# # and here's our code -#} +#------------------------------------------------- +sub dropLineageInAssetIndex { + my $session = shift; + print "\tDropping lineage column in assetIndex table.\n" unless ($quiet); + + $session->db->write('alter table assetIndex drop column lineage'); +} diff --git a/lib/WebGUI/Search.pm b/lib/WebGUI/Search.pm index 6d25b2691..afdff7c1e 100644 --- a/lib/WebGUI/Search.pm +++ b/lib/WebGUI/Search.pm @@ -144,12 +144,14 @@ Returns a WebGUI::SQL::ResultSet object containing the search results with colum sub getResultSet { my $self = shift; - my $query = "select assetId, title, url, synopsis, ownerUserId, groupIdView, groupIdEdit, creationDate, revisionDate, className "; + my $query = "select t1.assetId, t1.title, t1.url, t1.synopsis, t1.ownerUserId, t1.groupIdView, t1.groupIdEdit, t1.creationDate, t1.revisionDate, t1.className "; $query .= " , ".$self->{_score} if ($self->{_score}); - $query .= " from assetIndex where "; + $query .= " from assetIndex as t1, asset as t2 where "; + $query .= " t1.assetId=t2.assetId and "; $query .= "isPublic=1 and " if ($self->{_isPublic}); $query .= "(".$self->{_where}.")"; $query .= " order by score desc " if ($self->{_score}); + my $rs = $self->session->db->prepare($query); $rs->execute($self->{_params}); return $rs; @@ -298,7 +300,7 @@ sub search { foreach my $lineage (@{$rules->{lineage}}) { next unless defined $lineage; push(@params, $lineage."%"); - push(@phrases, "lineage like ?"); + push(@phrases, "t2.lineage like ?"); } push(@clauses, join(" or ", @phrases)) if (scalar(@phrases)); } diff --git a/lib/WebGUI/Search/Index.pm b/lib/WebGUI/Search/Index.pm index 3433ab654..a1e5b9385 100644 --- a/lib/WebGUI/Search/Index.pm +++ b/lib/WebGUI/Search/Index.pm @@ -131,10 +131,10 @@ sub create { #-------------------- added by zxp end my $add = $self->session->db->prepare("insert into assetIndex (assetId, title, url, creationDate, revisionDate, - ownerUserId, groupIdView, groupIdEdit, lineage, className, synopsis, keywords) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"); + ownerUserId, groupIdView, groupIdEdit, className, synopsis, keywords) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $add->execute([$asset->getId, $asset->get("title"), $asset->get("url"), $asset->get("creationDate"), $asset->get("revisionDate"), $asset->get("ownerUserId"), $asset->get("groupIdView"), $asset->get("groupIdEdit"), - $asset->get("lineage"), $asset->get("className"), $synopsis, $keywords]); + $asset->get("className"), $synopsis, $keywords]); return $self; } diff --git a/www/extras/tabs/tabs.css b/www/extras/tabs/tabs.css index 28af9b5a0..4a29c9b7c 100644 --- a/www/extras/tabs/tabs.css +++ b/www/extras/tabs/tabs.css @@ -14,7 +14,7 @@ .tabBody { width: auto; padding: 8px 12px 12px 12px; - z-index: 500; + z-index: 0; } div.tabs {