From ebffc8041ba403c05aaa597adf92650c2a2e9214 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 10 Sep 2009 16:38:42 -0700 Subject: [PATCH 1/7] Fix a POD typo in the Newsletter CS. --- lib/WebGUI/Asset/Wobject/Collaboration/Newsletter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 633f10d1b09a1ba8686296fe3380d75607875e44 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 11 Sep 2009 08:25:37 -0700 Subject: [PATCH 2/7] Remove debug code. --- lib/WebGUI/Asset.pm | 1 - 1 file changed, 1 deletion(-) 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 "" ) { From b090f92d7851f694c07c95e65d7889c362c22489 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 11 Sep 2009 08:30:42 -0700 Subject: [PATCH 3/7] Fix the Newsletter template. Hide subscribe link if used in a CS, and change the namespace. --- docs/changelog/7.x.x.txt | 1 + .../packages-7.8.0/newslettercstemplate.wgpkg | Bin 0 -> 1547 bytes 2 files changed, 1 insertion(+) create mode 100644 docs/upgrades/packages-7.8.0/newslettercstemplate.wgpkg diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2b8d17190..58b23af66 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -32,6 +32,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 0000000000000000000000000000000000000000..ab87f5b05db2be45862d07d05d7634c4ae82bfac GIT binary patch literal 1547 zcmV+m2K4zKiwFP!00000|Ls_9Pa8Q9=5v3=D%G7@spJjv!X_7~2kn(BP^1Dq-Q^BB zyH4V=u`Syn1j>KEvAtP)Hyc!`Ae~Mu5=%Uu$K!c>CRDec{;AjNola|OOTXK@=H1wZ zcaS~xtwy8SYVNjMZP*wz8ucA`fy&cAbE%L3(;}7-dbRnyxx_+l7VFEwV=iaj4{ZG} ziHy|^_q*9Pe>baNC8LjIC?K}exR=Gh(`gsuzq`|b_=7i}{&}kSSD)VW$2j5c1r%XL z;Tcbm!k0)X6isKCDp?7_;IF^m7`aqTpb7SuxL_O$MX=duU^G&KqYeaOO zBnCx`BZ1+V_}8U|s_axU0aT$f_!T}MB}7hf?1U6Az7QI-h0&@z0lrZJeZVL_Llb$5 zqASqSzVl@q+Zhq=%^lg-o2@M6AOjVDgIM#SO{H8Z% zRB3!1?r~*5jnRxG%Mb~IlHR>%P=N02A&V(d*i-F-syQXb5yU|oAA)IEK*z!bh;YiT zvA8R4r%dnc*Nk5V&Vh1C8JA=|P&v;&?9(CjFL5`dL-l}bwYbE+dO7c6z2do9e_V65 zUi96qKj&SZt>oN3r1yENQDE%${hw)?@aY)nm7-%^91Law)kec&7d1^tQl(X3hSY_I zEhrY}z&eLEr@dmCi^PNk>Ov+MY!Z=Nm9PUqQeu@V`#Vj8*S{KWFOjE$DW(giSYt$f zAaRUoab4F3KaAhSL>ZB1UuKJ`MHEmp({)JVzJfk;d5uJn8aEhL0upbO4f-`S0Jl@C zNXCK0QbPV$0i%lI8KIx3-k|z?;J_oOI>8bN>Kvr~nmLw?^H4F7(DasPL?zf_Oq(8v zGVA>sEN+ItG7^OAinIvX{oHs&7k|9P!?rQ6Y!}$kH`xm2{d~+aW$M}uAePG z&qvvPLvDFz%m23TbLPFG^m`mVxxa-n`YxdU=v1^y{7t{mP1OITxz*leOJC zuEaSKBN0v4{gbZyF0z>df#yL?c9C+U7eL00cr2@ME6>}57eZpL>|u*MffUxV{*MYu^@f21W^gwgWVlpP_ zY@xrXw7boAr|TfnUU)&U9Z@kCg}TIy$*HH=EL)Al;DzT@1md^c-6z}Rs#>$$_W*5F2cDxx-C$Of3gVg|8 z79ij^80oT{a2J9$Yv;z*6lu=!;N_Gp4(WR)X4ZY4!!@l*jw0)~eU?B&N#`?n0H%>x za#IXN=oL-+gX@oyWm>x%m~t~qy4uY8eU2ado4Bz|(c?bXN_X{0qvekcj{o003-M|8f8T literal 0 HcmV?d00001 From 785523f0b05bb0815426e2afeb18460ef7d674ff Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 11 Sep 2009 12:49:42 -0700 Subject: [PATCH 4/7] remove dead code from NotifyAboutThing. --- lib/WebGUI/Workflow/Activity/NotifyAboutThing.pm | 1 - 1 file changed, 1 deletion(-) 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.', From 229aaaa2702a663e231906ecee462a34fba0ce26 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 11 Sep 2009 13:08:47 -0700 Subject: [PATCH 5/7] Fix POD, remove dead code, use correct TTL in SendNewsletters. --- lib/WebGUI/Workflow/Activity/SendNewsletters.pm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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); From 7fff83f8ad2386bb8acfdd1f0e34b89c7f0e6203 Mon Sep 17 00:00:00 2001 From: daviddelikat Date: Sat, 12 Sep 2009 01:09:59 -0500 Subject: [PATCH 6/7] fixed the name of an upgrade function, now the upgrade works --- docs/upgrades/upgrade_7.7.19-7.8.0.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 0b1deab40c0feaa0d4e60bf06d5eab38a2f80c50 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 13 Sep 2009 06:15:34 -0700 Subject: [PATCH 7/7] Refactor getMetaDataFields to use WebGUI::SQL methods. --- lib/WebGUI/AssetMetaData.pm | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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; } }