From 0ee4a7fa90b917eef2bbf7d4fc6196a60bb3d708 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 19 Oct 2009 15:21:39 -0700 Subject: [PATCH 1/7] Make display of failed transactions more obvious in the Account/Shop plugin. --- ...collateral-items_my-purchases-default.wgpkg | Bin 0 -> 1641 bytes ...ral-items_my-purchases-detail-default.wgpkg | Bin 0 -> 2767 bytes lib/WebGUI/Shop/TransactionItem.pm | 7 ++++--- lib/WebGUI/i18n/English/Shop.pm | 17 +++++++++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-default.wgpkg create mode 100644 docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-detail-default.wgpkg diff --git a/docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-default.wgpkg b/docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-default.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..2e7f0681958bf70ad4052071f0ace631c6c92e6f GIT binary patch literal 1641 zcmV-v2A26BiwFP!00000|Ls^&Z`(Ey&U1f-;9^4y)Ujkcb}V}V(l%~_CRxxV>wtMJ zXo;4%N~A_ocHAKUeMd^NC|gc5Ai?$!35g8e>F)UP?mJSuJ5PVvw%zaV?d+&$udAO< z7oOJYvUeP(-Rn91zHK`@mgCrMc)%-9f2Beq4xxE0BJ|sKf2qJ+Y!|D^!KEjspZBQ# zpF}!pr~Kd9*T467{}PNoQlMb5m#=%x`a5>F*IrxyZl~SZu>j4dzn*IScb`7=$MA6b z0*bI9ahya*;;%?bnIGs=?3G1&3nE|qSh z)6nlLL4<@nx=9!Z>7jmyrctyKLlsJGzmcTVh=>sT<+~IwJ`?J*g*IxJ042v_2nqi!v}e_jxiJ0o1krWcaPzir0sJD{TdapaR!G+}n9%CnxK5lT}7 z?ovka55QASRFd55$6T(L zMy)8N2Ov|enPM9El#Zp-x)OrQCo{Jn?z*g``#om`RpWZ2t{&>!FC1>JSYBq8DQ+#c zidId@RpeU=ucBkFXIXxkN+o@u9@HqTaZ!#FS{5V{0?WJ@+kqU*zGwe^I6lAby#4Ss zouAKxQa9z1u1gWJBmv@XdWZwTu}C#rj-n=zKrCAEvYF(~M>KsrLun*SBSah%-^Wy2 za?J4y&LmU4OpA=ZsG3J|;ve}$YLP)2MXT52BcIGI4{}97H!M3K^g{)}DD13+x*@{& zmlFz+Q>1zxieAM_YZdvMOPJ;Bq4jeN;W9b2zMxl=#wRROPA$o-L(hYjCMS*8!%-{j zC>P3!L{sRxa2 z=P{33pr)d!eF4QP?gy#*u&!0b;*3)h$R+G~Qc+ch09rB&UIkT7Xv+L$J~!B_eT^7P zECVdDF>n81gshO`89+3W>YX{_)|}wQdn^%&u6c9-3tEaaF6SDSgHa2?pUluypn$cN zjSP?Nas|S#vtm0{=#@Yew#dvP;xhF-EW|90*4HVQ6!>WOI1+eWZw!;cexcUVdSq6( ztpZv=m!Z{?C8{l*hcG^BK~ccdC^Q;kP9y*}<}AKI9Ja^n6{q*F??Oa_+RZPaINv`v zY<1O~xJrMz7S2(emGx&l{cwHax`&E)T=y#9s+a1D>d%-@W+dO_I_#KWq=9duv5}Lw!r4P$5&^kn;;T#%G4<# zJGfMiCPd^Qtxw8ab1fST`h&qs zth|DgWqDL6e)Cf;i z?l2!kie=JZ>hWbFFKTjDq9ETLoqp)p-v^)4EW&wa^@AzuoP2jG6#`0PfDiL+5coZO`w?$dBJSyBBwl@zv$o#xnxX2s|V3-y`r3(KK7=02%-QT#z(= literal 0 HcmV?d00001 diff --git a/docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-detail-default.wgpkg b/docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-detail-default.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..e0261ffe51cdd44b16b3a6ffeec3958916ff1186 GIT binary patch literal 2767 zcmV;=3NZB_iwFP!00000|Lq$6Z`(FDKku&)QXH@Wb!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I/Shop/TransactionItem.pm index da0a4b321..97aa66abc 100644 --- a/lib/WebGUI/Shop/TransactionItem.pm +++ b/lib/WebGUI/Shop/TransactionItem.pm @@ -265,7 +265,8 @@ The status of this item. The default is 'NotShipped'. Other statuses include: Ca sub update { my ($self, $newProperties) = @_; my $id = id $self; - my $session = $self->transaction->session; + my $transaction = $self->transaction; + my $session = $transaction->session; my $taxDriver = WebGUI::Shop::Tax->getDriver( $session ); if (exists $newProperties->{item}) { @@ -296,7 +297,7 @@ sub update { $newProperties->{ taxConfiguration } = to_json( $taxDriver->getTransactionTaxData( $sku, $address ) || '{}' ); - unless ($sku->isShippingRequired) { + if (!$sku->isShippingRequired && $transaction->get('isSuccessful')) { $newProperties->{orderStatus} = 'Shipped'; } } @@ -310,7 +311,7 @@ sub update { if (exists $newProperties->{options} && ref($newProperties->{options}) eq "HASH") { $properties{$id}{options} = JSON->new->encode($newProperties->{options}); } - $properties{$id}{lastUpdated} = WebGUI::DateTime->new($self->transaction->session,time())->toDatabase; + $properties{$id}{lastUpdated} = WebGUI::DateTime->new($session,time())->toDatabase; $self->transaction->session->db->setRow("transactionItem","itemId",$properties{$id}); } diff --git a/lib/WebGUI/i18n/English/Shop.pm b/lib/WebGUI/i18n/English/Shop.pm index 7b0f30d32..018dd39cc 100644 --- a/lib/WebGUI/i18n/English/Shop.pm +++ b/lib/WebGUI/i18n/English/Shop.pm @@ -621,6 +621,12 @@ our $I18N = { context => q|field label| }, + 'Status' => { + message => q|Status|, + lastUpdated => 0, + context => q|Whether a transaction was successful, or not.| + }, + 'payment method' => { message => q|Payment Method|, lastUpdated => 0, @@ -1695,6 +1701,17 @@ our $I18N = { context => q|commerce setting help| }, + 'Success' => { + message => q|Success|, + lastUpdated => 0, + context => q|commerce setting help| + }, + + 'Failed' => { + message => q|Failure|, + lastUpdated => 0, + context => q|commerce setting help| + }, }; From 7ff4c17f4561f86c04e899efb99344c77ffc0529 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 19 Oct 2009 15:23:03 -0700 Subject: [PATCH 2/7] Changelog notice for Shop/Transaction work --- docs/changelog/7.x.x.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 024d86bf1..ce6937f59 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -24,6 +24,7 @@ - fixed #11139: referencing an item in the clipboard - fixed #11146: Upgrade Error 7.7.21 to 7.7.22 - fixed #11147: fail safe template is missing embedded style + - fixed #11137: Customers see failed orders 7.8.1 - mark $session->datetime->time as deprecated and remove its use from core code From 68be37b780fd452fbaaa323d42b14282b46c3617 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 19 Oct 2009 15:23:36 -0700 Subject: [PATCH 3/7] Do manual uniqification of items in Syndicated Content. Fixes bug #11156 Do not use merge because it uses normalize, which uses uniq_item, which uses only links to determine uniqueness. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/SyndicatedContent.pm | 36 ++++++++++++------- t/Asset/Wobject/SyndicatedContent.t | 3 -- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index ce6937f59..a2d65c2fd 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -25,6 +25,7 @@ - fixed #11146: Upgrade Error 7.7.21 to 7.7.22 - fixed #11147: fail safe template is missing embedded style - fixed #11137: Customers see failed orders + - fixed #11156: Syndicated Content doesn't show all headlines in feed 7.8.1 - mark $session->datetime->time as deprecated and remove its use from core code diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index fc10a362f..c1da1d9e1 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -133,7 +133,7 @@ sub generateFeed { my $limit = shift || $self->get('maxHeadlines'); my $feed = XML::FeedPP::Atom->new(); my $log = $self->session->log; - + # build one feed out of many my $newlyCached = 0; foreach my $url (split(/\s+/, $self->get('rssUrl'))) { @@ -154,35 +154,45 @@ sub generateFeed { utf8::downgrade($value, 1); eval { my $singleFeed = XML::FeedPP->new($value, utf8_flag => 1, -type => 'string'); - $feed->merge($singleFeed); + $feed->merge_channel($singleFeed); + $feed->merge_item($singleFeed); }; if ($@) { $log->error("Syndicated Content asset (".$self->getId.") has a bad feed URL (".$url."). Failed with ".$@); } } - + + # build a new feed that matches the term the user is interested in if ($self->get('hasTerms') ne '') { my @terms = split /,\s*/, $self->get('hasTerms'); # get the list of terms my $termRegex = join("|", map quotemeta($_), @terms); # turn the terms into a regex string my @items = $feed->match_item(title => qr/$termRegex/msi); push @items, $feed->match_item(description => qr/$termRegex/msi); - $feed->clear_item; - $feed->uniq_item; - foreach my $item (@items) { - $feed->add_item($item); - } + $feed->clear_item; + ITEM: foreach my $item (@items) { + $feed->add_item($item); + } } - + + my %seen = {}; + my @items = $feed->get_item; + $feed->clear_item; + ITEM: foreach my $item (@items) { + my $key = join "\n", $item->link, $item->pubDate, $item->description, $item->title; + next ITEM if $seen{$key}++; + $feed->add_item($item); + } + # sort them by date and remove any duplicate from the OR based term matching above - $feed->normalize(); - + $feed->sort_item(); + # limit the feed to the maximum number of headlines (or the feed generator limit). $feed->limit_item($limit); - + # mark this asset as updated $self->update({}) if ($newlyCached); - + return $feed; } diff --git a/t/Asset/Wobject/SyndicatedContent.t b/t/Asset/Wobject/SyndicatedContent.t index 270d59d30..7cce86dd8 100644 --- a/t/Asset/Wobject/SyndicatedContent.t +++ b/t/Asset/Wobject/SyndicatedContent.t @@ -162,9 +162,6 @@ $cache->set($rssContent, 60); my $filteredFeed = $syndicated_content->generateFeed(); -use Data::Dumper; -diag Dumper($filteredFeed->get_item()); - cmp_deeply( [ map { $_->title } $filteredFeed->get_item() ], [ From b027a8ab4d1cbc11fcea425810c9c950cbc28c3a Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 19 Oct 2009 16:44:11 -0700 Subject: [PATCH 4/7] Document odd rss feed with a test. --- t/Asset/Wobject/SyndicatedContent.t | 33 +++++++++- t/supporting_collateral/oncp.xml | 95 +++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 t/supporting_collateral/oncp.xml diff --git a/t/Asset/Wobject/SyndicatedContent.t b/t/Asset/Wobject/SyndicatedContent.t index 7cce86dd8..84fb34d2d 100644 --- a/t/Asset/Wobject/SyndicatedContent.t +++ b/t/Asset/Wobject/SyndicatedContent.t @@ -20,7 +20,7 @@ use Data::Dumper; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 21; # increment this value for each test you create +use Test::More tests => 22; # increment this value for each test you create use Test::Deep; use WebGUI::Asset::Wobject::SyndicatedContent; use XML::FeedPP; @@ -173,3 +173,34 @@ cmp_deeply( ); $cache->delete; + +#################################################################### +# +# Odd feeds +# +#################################################################### + + +##Feed with no links or pubDates. +my $oncpUrl = 'http://www.oncp.gob.ve/oncp.xml'; +$syndicated_content->update({ + rssUrl => $oncpUrl, + hasTerms => '', + maxHeadlines => 50, +}); + +my $cache = WebGUI::Cache->new($session, $oncpUrl, 'RSS'); +open my $rssFile, '<', WebGUI::Test->getTestCollateralPath('oncp.xml') + or die "Unable to get RSS file: oncp.xml"; +my $rssContent = do { local $/; <$rssFile>; }; +close $rssFile; +$cache->set($rssContent, 60); + +my $oddFeed1 = $syndicated_content->generateFeed(); + +my @oddItems = $oddFeed1->get_item(); +is (@oddItems, 13, 'feed has items even without pubDates or links'); + +$cache->delete; + + diff --git a/t/supporting_collateral/oncp.xml b/t/supporting_collateral/oncp.xml new file mode 100644 index 000000000..7e5abe22a --- /dev/null +++ b/t/supporting_collateral/oncp.xml @@ -0,0 +1,95 @@ + + + <![CDATA[Oficina Nacional de Crédito Público]]> + http://www.oncp.gob.ve + Información Financiera + es-ve + Oficina Nacional de Crédito Público - 2009 + + Oficina Nacional de Crédito Público + http://www.oncp.gob.ve/data/themes/digital//banner/oncp.png + http://www.oncp.gob.ve + + + + <![CDATA[Deuda Interna I Sem 09 / MM US$ 20.441]]> + http://www.oncp.gob.ve + + http://www.oncp.gob.ve + + + + <![CDATA[Deuda Externa I Sem 09 / MM US$ 29.894]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Tasa Pasiva / 14,52%]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Tasa Activa / 19,56%]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Variación PIB II Trimestre / -2,4%]]> + http://www.oncp.gob.ve + + + + + <![CDATA[PIB II Trimestre 2009 / M BsF 13.979.77]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Unidad Tributaria / BsF. 55,00]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Cesta Venezolana / US$ 65,32]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Cesta OPEP / US$ 67,92]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Variación Acumuladaa / 15,6%]]> + http://www.oncp.gob.ve + + + + + <![CDATA[IPC Variación Agosto 2009 / 2,2%]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Reservas Internacionales con BCV + FEM / MM US$ 33.213 (32.384 + 829)]]> + http://www.oncp.gob.ve + + + + + <![CDATA[Variación Acumulada / 15,6%]]> + http://www.oncp.gob.ve + + + + + + From da9f836232cf94e7ebf5c10237a2a9db7703f02f Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 19 Oct 2009 17:55:55 -0700 Subject: [PATCH 5/7] Autocommit version tags when using the RTE form control for folder/files. Fixes bug #11138 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Form/HTMLArea.pm | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index a2d65c2fd..100d929dd 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -26,6 +26,7 @@ - fixed #11147: fail safe template is missing embedded style - fixed #11137: Customers see failed orders - fixed #11156: Syndicated Content doesn't show all headlines in feed + - fixed #11138: RichEdit, upload image does not commit a version tag 7.8.1 - mark $session->datetime->time as deprecated and remove its use from core code diff --git a/lib/WebGUI/Form/HTMLArea.pm b/lib/WebGUI/Form/HTMLArea.pm index 21505afa4..c830fd817 100644 --- a/lib/WebGUI/Form/HTMLArea.pm +++ b/lib/WebGUI/Form/HTMLArea.pm @@ -386,8 +386,8 @@ sub www_addFolderSave { title => $filename, menuTitle => $filename, url => $base->getUrl.'/'.$filename, - groupIdEdit => $session->form->process('groupIdEdit') || $base->get('groupIdEdit'), - groupIdView => $session->form->process('groupIdView') || $base->get('groupIdView'), + groupIdEdit => $base->get('groupIdEdit'), + groupIdView => $base->get('groupIdView'), ownerUserId => $session->user->userId, startDate => $base->get('startDate'), endDate => $base->get('endDate'), @@ -410,6 +410,7 @@ sub www_addFolderSave { className => 'WebGUI::Asset::Wobject::Folder', #filename => $filename, }); + WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, { allowComments => 0 }); $session->http->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree')); return undef; } @@ -495,6 +496,7 @@ sub www_addImageSave { $child->update({url => $child->fixUrl}); $child->applyConstraints; } + WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, { allowComments => 0 }); $session->http->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree')); return undef; } From c8542cc5d012e78095e4e0e05e0c8f8f8c69d880 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 19 Oct 2009 20:18:21 -0700 Subject: [PATCH 6/7] Add another operation to robots.txt. Fixes bug #2569. --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/packages-7.8.2/robots.txt.wgpkg | Bin 808 -> 826 bytes 2 files changed, 1 insertion(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 100d929dd..67acc0692 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,7 @@ - fixed #11060: Some tables have latin1 as the default character set - fixed #11089: No message body in Notification - fixed #2569: robots.txt issues + - refixed #2569: robots.txt issues - fixed #11104: Wrong name for request tracker post form template - fixed #11077: Untested result in WebGUI::Storage->getFiles - fixed #11080: Asset Manage Crumb Trail flyout menu diff --git a/docs/upgrades/packages-7.8.2/robots.txt.wgpkg b/docs/upgrades/packages-7.8.2/robots.txt.wgpkg index 3c420b59bc49de98b5e2ae4d27768bd779669557..a05051e2e5c9566794baf4f43dd9e9ccc9c58093 100644 GIT binary patch literal 826 zcmV-A1I7FwiwFP!00000|Ls*lZ`v>v=GpEViVX2hEuS`h96||5hm@HoImkHqF<#2vDwe;ci^OddtQ%IwB&2P(Z z&IKiJ3Q<+>l)CTJzoq2f(ZAL4{D!62Jp4M8{>{Tfe~S)(PSgtnbhggl+AUje&I1V&@?ym(SJA%CAz6}a!)nT;u5Yt!nqV=5 z$m9}O-eD5ar7r52fLIgC1g@8ZmE`COP&7fY7@=^X$|*q4TGAx}eyhfIpkr0A&(dp& zNC=Q+5}R^5rBV;b_Qy2{GoEPBdY5R*l{7Idu5c6q**z5&BTgliYgRB)IdIHr#s<+v zgr&}My-GPU1CHe_Prh=Rjt~b@Y^vld)j|-WFD8((WJ7sngVy2843T)Rh?qd>1KZpQ zj=mpSzJU@dwZ#yn1^zpjUfvFRy?)MHuQw)`F{tp6TjPdC_!llzvR%*bIF9SJJEmlc zQG)_QS|DK#>T4kS>*~6R!iFi1|)*jy*i@dG(_PHCd#QaD@L!Sd~Cu%LcV5lv_}nz;_^oM)<-vO zpUoDToU^;f;duCaK3JL}Sd7;~Lb@xLcEiR?cE!I~6!&h&92qz=aAe@fz`tYQFVUanZ~zbh E0H$!9Z~y=R literal 808 zcmV+@1K0c?iwFP!00000|Ls*>PunmQ?K8ik$|D+GoHQ-1G)*uVLt|Yf3QUYWxXC3o zO>ED0Xv@TZpW~#B`vFf>;-P+Ms$Ade<8#ivY1FpAT-R;4gIXM&)5~1WJYU)Ro75)8IuD@n;`)gbJH?|M`El&8ir<>4`iU}NpQ}5P)|M_5E zaltqUML_0n&9;1JC;%&nj%WE>$9K%;Jdj|iPN$p+9X&ERG)t02Sa+E+^&OrK6Cy_t zRk;)%y^M89$Fs zBce_?PCG7*kt8v)k2W+NDd(7$((X)gVEv32-A3@h=fAv1E-n^ zu9**hP(cZ`+Omh!0{;yR&#un9-J_hhZugQB&cWg#x5f_^k$Y08WAy$MHa##|kK(oQC#dFd! zV?qaWP4S~`UgMTa@>F1JdRAp3FIaBPqFa{CY3pE=?sVFnPSEx&tpq$0sR5tNb=<_8 zHj}phLbU4I`h!(8#=K2dZ72(!s_t>}W;xKMsOr{Z#^MCD_3!8jkvK`%q+8$r%=o8> zNG;9mg2jZc1yekRz93ZLVFGuSeC25dgniEbS_zz~(fZ3UWEoutgCFqpOm{0f?5*Xj zV6oAJI2^%1TaIN#5BV+EVjgHHW?c0*(5i4;jt2MI&C=fW!S}!C_fNn2Kc7x+Z_~IE zfXK_4RFJOnZe*RC!dbFQF+g+bOp+Bdb9c!LsHs1uUVyAk+{}a$UjNuQb1}5cA8VW} m{88e|r~dQa^ILpWb~Sbk>=@WFuw&reGw>gPj4I9m5C8xHo0<{; From e4b18757d81f61a9c6acbb99a606bcad66c349a4 Mon Sep 17 00:00:00 2001 From: Patrick Donelan Date: Tue, 20 Oct 2009 16:50:00 +1100 Subject: [PATCH 7/7] Fixes bug in ExpireIncompleteSurveyResponses Use a left outer join on userProfileData so that the workflow processes responses for users that have been deleted --- docs/changelog/7.x.x.txt | 1 + .../Workflow/Activity/ExpireIncompleteSurveyResponses.pm | 4 ++-- t/Workflow/Activity/ExpireIncompleteSurveyResponses.t | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 67acc0692..aa9a5baae 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -28,6 +28,7 @@ - fixed #11137: Customers see failed orders - fixed #11156: Syndicated Content doesn't show all headlines in feed - fixed #11138: RichEdit, upload image does not commit a version tag + - fixed ExpireIncompleteSurveyResponses Workflow: process responses for deleted users 7.8.1 - mark $session->datetime->time as deprecated and remove its use from core code diff --git a/lib/WebGUI/Workflow/Activity/ExpireIncompleteSurveyResponses.pm b/lib/WebGUI/Workflow/Activity/ExpireIncompleteSurveyResponses.pm index 03b836d9d..73d2baf16 100644 --- a/lib/WebGUI/Workflow/Activity/ExpireIncompleteSurveyResponses.pm +++ b/lib/WebGUI/Workflow/Activity/ExpireIncompleteSurveyResponses.pm @@ -159,6 +159,7 @@ Factored out into a separate subroutine for the sake of testability. sub getSql { + # Use a left outer join on userProfileData so that we still get back responses for users that have been deleted return < 0 @@ -175,7 +176,6 @@ where and ad.assetId = s.assetId and ad.revisionDate = s.revisionDate and s.revisionDate = r.revisionDate - and upd.userId = r.userId END_SQL } diff --git a/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t b/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t index d80df1019..8dc6a208f 100644 --- a/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t +++ b/t/Workflow/Activity/ExpireIncompleteSurveyResponses.t @@ -13,7 +13,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -plan tests => 25; +plan tests => 26; use_ok('WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses'); @@ -127,6 +127,13 @@ $session->db->write('update Survey_response set endDate = 0, isComplete = 0 wher # Make sure SQL only returns 1 incomplete response is( scalar $session->db->buildArray($SQL), 1, 'Make sure SQL only returns 1 incomplete response'); +## +# Make sure workflow handles responses for deleted users +# +$session->db->write('update Survey_response set userId = ? where Survey_responseId = ?', ['not-a-user-id', $responseId]); +is( scalar $session->db->buildArray($SQL), 1, 'Still returns 1 row, even though user does not exist (sql left outer join)'); +$session->db->write('update Survey_response set userId = ? where Survey_responseId = ?', [$user->getId, $responseId]); + ## # Delete Expired ##