diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f99a05480..8ce8724c5 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,7 @@ - fixed #11311: Search object and modifiers - fixed #11314: hover help clarity - fixed #11317: wrong error message in AssetProxy + - fixed #11318: searching in a collaborationsystem 7.8.8 - fixed #11289: Gallery with pending version tag causes search engine indexer to puke. diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 717057eba..8b4ae34e8 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -130,7 +130,7 @@ sub appendPostListTemplateVars { if ($self->get("displayLastReply")) { my $lastPost = $post->getLastPost(); %lastReply = ( - "lastReply.url" => $lastPost->getUrl.'#'.$lastPost->getId, + "lastReply.url" => $lastPost->getUrl.'#id'.$lastPost->getId, "lastReply.title" => $lastPost->get("title"), "lastReply.user.isVisitor" => $lastPost->get("ownerUserId") eq "1", "lastReply.username" => $lastPost->get("username"), @@ -142,12 +142,13 @@ sub appendPostListTemplateVars { } $hasRead = $post->isMarkedRead; } - my $url; - if ($post->get("status") eq "pending") { - $url = $post->getUrl("revision=".$post->get("revisionDate"))."#".$post->getId; - } else { - $url = $post->getUrl."#".$post->getId; - } + my $url; + if ($post->get("status") eq "pending") { + $url = $post->getUrl("revision=".$post->get("revisionDate"))."#id".$post->getId; + } + else { + $url = $post->getUrl."#id".$post->getId; + } my %postVars = ( %{$post->get}, "id" => $post->getId, diff --git a/t/Asset/Wobject/Collaboration/templateVariables.t b/t/Asset/Wobject/Collaboration/templateVariables.t index a1065306a..10ff8a086 100644 --- a/t/Asset/Wobject/Collaboration/templateVariables.t +++ b/t/Asset/Wobject/Collaboration/templateVariables.t @@ -24,7 +24,7 @@ use WebGUI::Session; #---------------------------------------------------------------------------- # Tests -plan tests => 21; # Increment this number for each test you create +plan tests => 23; # Increment this number for each test you create #---------------------------------------------------------------------------- # Init @@ -89,6 +89,8 @@ ok( !$posts->[0]->{'user.isVisitor'}, 'first post made by visitor'); ok( $posts->[0]->{'hideProfileUrl'}, 'hide profile url, and user is visitor'); ok( !$posts->[0]->{'lastReply.user.isVisitor'}, 'lastReply not made by visitor'); ok( $posts->[0]->{'lastReply.hideProfileUrl'}, 'lastReply hide profile url, since user is visitor'); +is( $posts->[0]->{'lastReply.url'}, $threads[1]->getUrl.'#id'.$threads[1]->getId, 'lastReply url has a query fragment prefixed by "id"'); +is( $posts->[0]->{'url'}, $threads[1]->getUrl.'#id'.$threads[1]->getId, 'url has a query fragment prefixed by "id"'); ###################################################################