diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2199f008f..3ecf837a7 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,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 @@ -25,6 +26,10 @@ - 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 + - 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/docs/upgrades/packages-7.8.2/robots.txt.wgpkg b/docs/upgrades/packages-7.8.2/robots.txt.wgpkg index 3c420b59b..a05051e2e 100644 Binary files a/docs/upgrades/packages-7.8.2/robots.txt.wgpkg and b/docs/upgrades/packages-7.8.2/robots.txt.wgpkg differ 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 000000000..2e7f06819 Binary files /dev/null and b/docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-default.wgpkg differ 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 000000000..e0261ffe5 Binary files /dev/null and b/docs/upgrades/packages-7.8.2/shopping-cart-collateral-items_my-purchases-detail-default.wgpkg differ 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/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; } diff --git a/lib/WebGUI/Shop/TransactionItem.pm b/lib/WebGUI/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/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/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| + }, }; diff --git a/t/Asset/Wobject/SyndicatedContent.t b/t/Asset/Wobject/SyndicatedContent.t index 270d59d30..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; @@ -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() ], [ @@ -176,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/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 ## 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 + + + + + +