diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2161703dc..166d434eb 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -33,6 +33,7 @@ - added Subscribable AssetAspect to Wiki - fixed #10941: New user profile fields with unfortunate names - fixed #10955: Story Manager: unable to import packages + - fixed #10970: Newsletter Asset: no subscribe link 7.7.19 - fixed #10838: Forwarded forum post email to new CS adds reply to original thread diff --git a/docs/upgrades/packages-7.8.0/newslettercstemplate.wgpkg b/docs/upgrades/packages-7.8.0/newslettercstemplate.wgpkg new file mode 100644 index 000000000..ab87f5b05 Binary files /dev/null and b/docs/upgrades/packages-7.8.0/newslettercstemplate.wgpkg differ diff --git a/docs/upgrades/upgrade_7.7.19-7.8.0.pl b/docs/upgrades/upgrade_7.7.19-7.8.0.pl index 5257bef4e..327385caa 100644 --- a/docs/upgrades/upgrade_7.7.19-7.8.0.pl +++ b/docs/upgrades/upgrade_7.7.19-7.8.0.pl @@ -51,7 +51,7 @@ finish($session); # this line required #---------------------------------------------------------------------------- # Add the column for featured wiki pages -sub exampleFunction { +sub addFeaturedPageWiki { my $session = shift; print "\tAdding featured pages to the Wiki " unless $quiet; diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 6c92f4657..0497938cd 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -2828,7 +2828,6 @@ sub www_editSave { $object = $object->cloneFromDb; } } - $session->log->warn('post object isa'. ref $object); # Handle "saveAndReturn" button if ( $session->form->process( "saveAndReturn" ) ne "" ) { diff --git a/lib/WebGUI/Asset/Wobject/Collaboration/Newsletter.pm b/lib/WebGUI/Asset/Wobject/Collaboration/Newsletter.pm index d678237ed..81e45200b 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration/Newsletter.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration/Newsletter.pm @@ -200,7 +200,7 @@ sub view { =head2 www_mySubscriptions -Build a form to dispaly to the user their current subscriptions, and allow them to +Build a form to display to the user their current subscriptions, and allow them to alter them. =cut diff --git a/lib/WebGUI/AssetMetaData.pm b/lib/WebGUI/AssetMetaData.pm index bac045b32..76e59da6f 100644 --- a/lib/WebGUI/AssetMetaData.pm +++ b/lib/WebGUI/AssetMetaData.pm @@ -151,8 +151,9 @@ If specified, the hashRef will contain only this field. =cut sub getMetaDataFields { - my $self = shift; + my $self = shift; my $fieldId = shift; + my $session = $self->session; my $sql = "select f.fieldId, f.fieldName, @@ -162,21 +163,15 @@ sub getMetaDataFields { f.possibleValues, d.value from metaData_properties f - left join metaData_values d on f.fieldId=d.fieldId and d.assetId=".$self->session->db->quote($self->getId); - $sql .= " where f.fieldId = ".$self->session->db->quote($fieldId) if ($fieldId); + left join metaData_values d on f.fieldId=d.fieldId and d.assetId=".$session->db->quote($self->getId); + $sql .= " where f.fieldId = ".$session->db->quote($fieldId) if ($fieldId); $sql .= " order by f.fieldName"; if ($fieldId) { - return $self->session->db->quickHashRef($sql); + return $session->db->quickHashRef($sql); } else { tie my %hash, 'Tie::IxHash'; - my $sth = $self->session->db->read($sql); - while( my $h = $sth->hashRef) { - foreach(keys %$h) { - $hash{$h->{fieldId}}{$_} = $h->{$_}; - } - } - $sth->finish; + %hash = %{ $session->db->buildHashRefOfHashRefs($sql, [], 'fieldId') }; return \%hash; } } diff --git a/lib/WebGUI/Workflow/Activity/NotifyAboutThing.pm b/lib/WebGUI/Workflow/Activity/NotifyAboutThing.pm index 1ab27f1c5..bd8660b34 100644 --- a/lib/WebGUI/Workflow/Activity/NotifyAboutThing.pm +++ b/lib/WebGUI/Workflow/Activity/NotifyAboutThing.pm @@ -84,7 +84,6 @@ sub execute { my $self = shift; my $thingy = shift; my $inbox = WebGUI::Inbox->new($self->session); - my $messageTemplate = $self->get('messageTemplate'); my $properties = { status => 'completed', subject => 'Thingy at URL ' . $thingy->getUrl . ' changed.', diff --git a/lib/WebGUI/Workflow/Activity/SendNewsletters.pm b/lib/WebGUI/Workflow/Activity/SendNewsletters.pm index 493282515..8f723e9ca 100644 --- a/lib/WebGUI/Workflow/Activity/SendNewsletters.pm +++ b/lib/WebGUI/Workflow/Activity/SendNewsletters.pm @@ -22,15 +22,11 @@ use WebGUI::Mail::Send; =head1 NAME -Package WebGUI::Workflow::Activity::Skeleton +Package WebGUI::Workflow::Activity::SendNewsletters =head1 DESCRIPTION -Tell a little about what this activity does. - -=head1 SYNOPSIS - -See WebGUI::Workflow::Activity for details on how to use any activity. +Process subscription requests from all Newsletters and send emails. =head1 METHODS @@ -62,7 +58,7 @@ sub definition { #------------------------------------------------------------------- -=head2 execute ( [ object ] ) +=head2 execute ( ) See WebGUI::Workflow::Activity::execute() for details. @@ -70,8 +66,6 @@ See WebGUI::Workflow::Activity::execute() for details. sub execute { my $self = shift; - my $object = shift; - my $instance = shift; my ($db,$eh) = $self->session->quick(qw(db errorHandler)); my $time = time(); @@ -195,7 +189,7 @@ sub execute { $db->write("update Newsletter_subscriptions set lastTimeSent = ?", [time()]); # timeout if we're taking too long - if (time() - $time > 50) { + if (time() - $time > $self->getTTL ) { $eh->info("Oops. Ran out of time. Will continue building newsletters in a bit."); $subscriptionResultSet->finish; return $self->WAITING(1);