diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index b32b66e34..2f856174b 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,6 +1,11 @@ 6.5.3 - fix [ 1161457 ] Data fomr - list all entries: Logfile Error - fix [ 1161461 ] Data form - Add field - wrong destination + - fix [ 1164382 ] User Profiling WebGUI::International::get(304,"WebGUI"); + - fix [ 1164251 ] message preview + - fix [ 1164208 ] Unable to move freely between pages of a forum + - fix [ 1160034 ] 6.5.0 - newly added posts do not appear + - fix [ 1027992 ] pagination in forum doesn't take you to correct page - fix [ 1149585 ] visitor as admin diff --git a/docs/upgrades/upgrade_6.5.2-6.5.3.sql b/docs/upgrades/upgrade_6.5.2-6.5.3.sql index 72c2f4ac5..87d970596 100644 --- a/docs/upgrades/upgrade_6.5.2-6.5.3.sql +++ b/docs/upgrades/upgrade_6.5.2-6.5.3.sql @@ -1,4 +1,5 @@ insert into webguiVersion values ('6.5.3','upgrade',unix_timestamp()); update template set template='\">\n\n

\n
\n\n

\n
\n\n\n\n\n\n\n

\n\n\n\n\">\n· \">\n\n· \">\n\n\n· \">\n· \">\n\n

\n\n\n\n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n *\n \n
\n \n
\n
\n
\n\n\n' where assetId='PBtmpl0000000000000141'; update template set assetId='\">\n\n

\n
\n \r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \">\r\n · \">\r\n \r\n · \">\r\n \r\n \r\n · \">\r\n · \">\r\n \r\n

\r\n\r\n\r\n\r\n

\r\n \r\n )\" id=\"tab\" class=\"tab\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n *\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000116'; +update template set template = '\">

\r\n

\n

\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n
\n\n

\n
\r\n\r\n\r\n\n

\n\n
' where assetId='PBtmpl0000000000000029'; diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 66c5a9669..3d64bdaff 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -15,6 +15,7 @@ use Tie::CPHash; use WebGUI::Asset; use WebGUI::Asset::Template; use WebGUI::Asset::Post::Thread; +use WebGUI::Cache; use WebGUI::DateTime; use WebGUI::Grouping; use WebGUI::HTML; @@ -665,6 +666,9 @@ sub processPropertiesFromFormPost { $storage->generateThumbnail($filename); } $session{form}{proceed} = "redirectToParent"; + # clear some cache + WebGUI::Cache->new("wobject_".$self->getThread->getParent->getId."_".$session{user}{userId})->delete; + WebGUI::Cache->new("cspost_".($self->getParent->getId)."_".$session{user}{userId}."_".$session{scratch}{discussionLayout}."_1")->delete; } @@ -840,6 +844,9 @@ sub www_edit { $self->{_thread} = $self->getParent->getThread; return WebGUI::Privilege::insufficient() unless ($self->getThread->canReply); $var{isReply} = 1; + $var{'reply.title'} = $self->getParent->get("title"); + $var{'reply.synopsis'} = $self->getParent->get("synopsis"); + $var{'reply.content'} = $self->getParent->formatContent; unless ($session{form}{content} || $session{form}{title}) { $content = "[quote]".$self->getParent->get("content")."[/quote]" if ($session{form}{withQuote}); $title = $self->getParent->get("title"); diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index 4351a0d94..0cea57200 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -608,12 +608,14 @@ sub view { } else { $sql .= "asset.lineage"; } - $p->setDataByQuery($sql); + my $currentPageUrl = $session{env}{PATH_INFO}; + $currentPageUrl =~ s/^\///; + $p->setDataByQuery($sql, undef, undef, undef, "url", $currentPageUrl); foreach my $dataSet (@{$p->getPageData()}) { my $reply = WebGUI::Asset::Post->newByPropertyHashRef($dataSet); $reply->{_thread} = $self; # caching thread for better performance my %replyVars = %{$reply->getTemplateVars}; - $replyVars{isCurrent} = ('/'.$reply->get("url") eq $session{env}{PATH_INFO}); + $replyVars{isCurrent} = ($reply->get("url") eq $currentPageUrl); $replyVars{isThreadRoot} = $self->getId eq $reply->getId; $replyVars{depth} = $reply->getLineageLength - $self->getLineageLength; $replyVars{depthX10} = $replyVars{depth}*10; diff --git a/lib/WebGUI/Asset/Wobject.pm b/lib/WebGUI/Asset/Wobject.pm index 9737b0db8..48ce040f6 100644 --- a/lib/WebGUI/Asset/Wobject.pm +++ b/lib/WebGUI/Asset/Wobject.pm @@ -569,7 +569,7 @@ sub www_view { my $cache; my $output; my $useCache = ( - $session{form}{op} eq "" && + $session{form}{op} eq "" && $session{form}{pn} eq "" && ( ( $self->get("cacheTimeout") > 10 && $session{user}{userId} ne '1') || ( $self->get("cacheTimeoutVisitor") > 10 && $session{user}{userId} eq '1') diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 9e944dcf3..23502c928 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -346,23 +346,23 @@ sub definition { }, notificationTemplateId =>{ fieldType=>"template", - defaultValue=>undef + defaultValue=>'PBtmpl0000000000000027' }, searchTemplateId =>{ fieldType=>"template", - defaultValue=>undef + defaultValue=>'PBtmpl0000000000000031' }, postFormTemplateId =>{ fieldType=>"template", - defaultValue=>undef + defaultValue=>'PBtmpl0000000000000029' }, threadTemplateId =>{ fieldType=>"template", - defaultValue=>undef + defaultValue=>'PBtmpl0000000000000032' }, collaborationTemplateId =>{ fieldType=>"template", - defaultValue=>undef + defaultValue=>'PBtmpl0000000000000026' }, karmaPerPost =>{ fieldType=>"integer", diff --git a/lib/WebGUI/Paginator.pm b/lib/WebGUI/Paginator.pm index bfc2406ed..28d15ffdb 100644 --- a/lib/WebGUI/Paginator.pm +++ b/lib/WebGUI/Paginator.pm @@ -476,7 +476,7 @@ sub setDataByArrayRef { #------------------------------------------------------------------- -=head2 setDataByQuery ( query [, dbh, unconditional, placeholders ] ) +=head2 setDataByQuery ( query [, dbh, unconditional, placeholders, dynamicPageNumberKey, dynamicPageNumberValue ] ) Retrieves a data set from a database and replaces whatever data set was passed in through the constructor. @@ -498,11 +498,19 @@ A boolean indicating that the query should be read unconditionally. Defaults to An array reference containing a list of values to be used in the placeholders defined in the SQL statement. +=head3 dynamicPageNumberKey + +One of the field names being returned from this query. If this is set, the paginator will dynamically assign a page number based upon this key matching the dynamicPageNumberValue. Note that this only applies if the default page number is 1. + +=head3 dynamicPageNumberValue + +A value to match the dynamicPageNumberKey. + =cut sub setDataByQuery { my ($sth, $rowCount, @row); - my ($self, $sql, $dbh, $unconditional, $placeholders) = @_; + my ($self, $sql, $dbh, $unconditional, $placeholders, $dynamicPageNumberKey, $dynamicPageNumberValue) = @_; $dbh ||= WebGUI::SQL->getSlave; if ($unconditional) { $sth = WebGUI::SQL->unconditionalRead($sql,$dbh,$placeholders); @@ -510,6 +518,7 @@ sub setDataByQuery { } else { $sth = WebGUI::SQL->read($sql,$dbh,$placeholders); } + my $defaultPageNumber = $self->getPageNumber; $self->{_totalRows} = $sth->rows; $self->{_columnNames} = [ $sth->getColumnNames ]; my $pageCount = 1; @@ -518,10 +527,18 @@ sub setDataByQuery { if ($rowCount/$self->{_rpp} > $pageCount) { $pageCount++; } - if ($pageCount == $self->getPageNumber) { - push(@row,$data); + if (defined $dynamicPageNumberKey && $defaultPageNumber == 1) { + if ($data->{$dynamicPageNumberKey} eq $dynamicPageNumberValue) { + $self->{_pn} = $pageCount; + $dynamicPageNumberKey = undef; + } + push(@row,$data); } else { - push(@row,{}); + if ($pageCount == $self->getPageNumber) { + push(@row,$data); + } else { + push(@row,{}); + } } } $sth->finish; diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 5e0aee69d..f0f93ef30 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -1,6 +1,11 @@ package WebGUI::i18n::English::WebGUI; our $I18N = { + '304' => { + message => q|Language|, + lastUpdated => 1031514049 + }, + '559' => { message => q|Run On Registration|, lastUpdated => 1031514049