diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 9e9ae35ca..3cb89d568 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.8.3 + - fixed: RSS feeds generated with incorrect link for channel - Fixed an error being thrown by the CalendarUpdateFeeds workflow activity. - The auto add to group and auto delete from group operations that are used with the GroupAdd and GroupDelete macros were fixed to make the user log in if they aren't already. - fixed #11074: Links to CS posts not working @@ -31,6 +32,12 @@ - fixed #10984: Edit Survey Screen isn't right in demo - added: getTopKeywords method to Keywords API - added: print remaining tickets feature to EMS + - fixed #11188: Incoherence in Navigation edit form + - fixed #11189: Controls variable missing in image asset in AssetProxy + - fixed #11190: event tmpl_var in help but not available + - fixed #11194: Event Asset Recurrence form is not i18n'ed + - fixed #11192: newByLineage tries to instantiate asset even if no assetId found + - fixed #11195: Shop, sometimes free checkout does not work 7.8.2 - Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 4ab569fda..ea33cacb3 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -1096,7 +1096,7 @@ sub getEditForm { } } - # send back the rendered form + # send back the object return $tabform; } diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index a83f44a9e..b309e7ecd 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -2063,6 +2063,13 @@ sub www_edit { size => 22, }); + # synopsis + $var->{"formSynopsis"} + = WebGUI::Form::textarea($session, { + name => "synopsis", + value => $form->process("synopsis") || $self->get("synopsis"), + }); + # Group to View $var->{"formGroupIdView"} = WebGUI::Form::Group($session, { @@ -2202,22 +2209,23 @@ sub www_edit { : $self->isAllDay ; + my $i18n = WebGUI::International->new($session, 'Asset_Event'); $var->{"formTime"} = q| - +
- +
| - . q|Start: |.$var->{"formStartTime"} - . q|
End: |.$var->{"formEndTime"} - . q|
Time Zone: |.$var->{formTimeZone} - . q|
|; + . $i18n->get('start') . q|: | . $var->{"formStartTime"} . q|
| + . $i18n->get('end') . q|: | . $var->{"formEndTime"} . q|
| + . $i18n->get('timezone', 'DateTime'). q|: | . $var->{formTimeZone} . q|| + ; ###### related links my $relatedLinks = $self->getRelatedLinks(); @@ -2234,8 +2242,8 @@ sub www_edit { value => $form->process("rel_group_id_".$_->{eventlinkId}) || $_->{groupIdView} || $self->getParent->get("groupIdView"), defaultValue => $self->getParent->get("groupIdView"), }); - $_->{seq_num_name} = "rel_seq_".$_->{eventlinkId}; - $_->{seq_num_id} = "rel_seq_id_".$_->{eventlinkId}; + $_->{seq_num_name} = "rel_seq_".$_->{eventlinkId}; + $_->{seq_num_id} = "rel_seq_id_".$_->{eventlinkId}; $_->{seq_num_value} = $seqNum++; } $var->{"relatedLinks"} = $relatedLinks; @@ -2258,90 +2266,88 @@ sub www_edit { = q|

-

+

-

+

- Every
+ |. $i18n->get('Every'). q|
-
+
- +
-

-

+

- Every week(s) on
+ |. sprintf($i18n->get('Every N weeks on'), q||). q|
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-

-

+

-

Every month(s) on

+

|. sprintf($i18n->get('Every N months on'), q||). q|

- +

week on + + + + + + |. $i18n->get('week on'). q|

-

+

-

Every years(s) on

+

|. sprintf($i18n->get('Every N years on'),q||). q|

@@ -2349,34 +2355,34 @@ sub www_edit {

of + + + + + + + + |. $i18n->get('of'). q|

@@ -2396,18 +2402,18 @@ sub www_edit { $var->{"formRecurEnd"} = q|
-
+
- | + | . WebGUI::Form::date($session,{ name => "recurEndDate", value => $recur{endDate}, defaultValue => $recur{endDate} }) . q|
- + - occurences. + |. $i18n->get('occurences'). q|.
|; @@ -2423,14 +2429,14 @@ sub www_edit { $var->{"formSave"} = WebGUI::Form::submit($session, { name => "save", - value => "save", + value => $i18n->get('62', 'WebGUI'), }); # Cancel button $var->{"formCancel"} = WebGUI::Form::button($session, { name => "cancel", - value => "cancel", + value => $i18n->get('cancel', 'WebGUI'), extras => 'onClick="window.history.go(-1)"', }); diff --git a/lib/WebGUI/Asset/Wobject/Calendar.pm b/lib/WebGUI/Asset/Wobject/Calendar.pm index e288cfa8d..b8f905701 100644 --- a/lib/WebGUI/Asset/Wobject/Calendar.pm +++ b/lib/WebGUI/Asset/Wobject/Calendar.pm @@ -1296,11 +1296,8 @@ sub viewList { ### Get the events my $dtStart = WebGUI::DateTime->new( $session, $params->{start} ); $dtStart->set_time_zone($tz); - $dtStart->truncate( to => 'day' ); my $dtEnd = $dtStart->clone->add( seconds => $self->get('listViewPageInterval') ); - warn 'truncated: '.$dtStart->toDatabase; - warn 'end date: '.$dtEnd->toDatabase; my @events = $self->getEventsIn( $dtStart->toDatabase, @@ -1910,8 +1907,6 @@ sub www_ical { $dt_start->set_time_zone( $session->datetime->getTimeZone ); } - $session->log->warn("start1: ". $dt_start->toMysql); - my $dt_end; my $end = $form->param("end"); if ($end) { @@ -1925,10 +1920,6 @@ sub www_ical { $dt_end = $dt_start->clone->add( seconds => $self->get('icalInterval') ); } - $session->log->warn("start2: ". $dt_start->toMysql); - $session->log->warn("end2: ". $dt_end->toMysql); - - # Get all the events we're going to display my @events = $self->getEventsIn($dt_start->toMysql,$dt_end->toMysql); @@ -1938,11 +1929,8 @@ sub www_ical { . qq{VERSION:2.0\r\n}; # VEVENT: - $session->log->warn("before event processing"); EVENT: for my $event (@events) { - $session->log->warn("have event: "); next EVENT unless $event->canView(); - $session->log->warn($event->getTitle); $ical .= qq{BEGIN:VEVENT\r\n}; ### UID diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index 35223f1c1..327a2bddf 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -281,20 +281,6 @@ sub getEditForm { ".($ancestorsChecked ? "" : "toggleAncestorEndPoint();")." //]]> "); - my $previewButton;# = qq{ - # }; - my $saveButton = ' '; - $tabform->{_submit} = $previewButton." ".$saveButton; return $tabform; } diff --git a/lib/WebGUI/AssetAspect/RssFeed.pm b/lib/WebGUI/AssetAspect/RssFeed.pm index b1caab66f..85e8db41f 100644 --- a/lib/WebGUI/AssetAspect/RssFeed.pm +++ b/lib/WebGUI/AssetAspect/RssFeed.pm @@ -483,7 +483,7 @@ sub getFeed { $feed->description( $self->get('feedDescription') || $self->get('synopsis') ); $feed->pubDate( $self->getContentLastModified ); $feed->copyright( $self->get('feedCopyright') ); - $feed->link( $self->getUrl ); + $feed->link( $self->session->url->getSiteURL . $self->getUrl ); # $feed->language( $lang ); if ($self->get('feedImage')) { my $storage = WebGUI::Storage->get($self->session, $self->get('feedImage')); diff --git a/lib/WebGUI/AssetLineage.pm b/lib/WebGUI/AssetLineage.pm index 0ecb6d70d..9db0ae1b3 100644 --- a/lib/WebGUI/AssetLineage.pm +++ b/lib/WebGUI/AssetLineage.pm @@ -821,6 +821,11 @@ sub newByLineage { $class = $assetLineage->{$lineage}{class}; unless ($id && $class) { ($id,$class) = $session->db->quickArray("select assetId, className from asset where lineage=?",[$lineage]); + if (!$id || !$class) { + $session->errorHandler->error("Couldn't instantiate asset from lineage: ".$lineage. ": class name or assetId missing"); + return undef; + } + return undef if !$id || !$class; $assetLineage->{$lineage}{id} = $id; $assetLineage->{$lineage}{class} = $class; $session->stow->set("assetLineage",$assetLineage); diff --git a/lib/WebGUI/Help/Asset_Event.pm b/lib/WebGUI/Help/Asset_Event.pm index 425b3dbc9..848ab1174 100644 --- a/lib/WebGUI/Help/Asset_Event.pm +++ b/lib/WebGUI/Help/Asset_Event.pm @@ -21,6 +21,7 @@ our $HELP = { 'required' => 1, }, { 'name' => 'formMenuTitle', }, + { 'name' => 'formSynopsis', }, { 'name' => 'formLocation', }, { 'name' => 'formDescription', }, { 'name' => 'formGroupToView', }, diff --git a/lib/WebGUI/Macro/AssetProxy.pm b/lib/WebGUI/Macro/AssetProxy.pm index 268cd3cc8..0e7ef77ce 100644 --- a/lib/WebGUI/Macro/AssetProxy.pm +++ b/lib/WebGUI/Macro/AssetProxy.pm @@ -27,9 +27,9 @@ Macro for displaying the output of an Asset in another location. =head3 url | assetId -My specify either the asset url or the asset id. If no Asset with that URL or id can be found, an internationalized error message will be returned instead. +Specify either the asset url or the asset id. If no Asset with that URL or id can be found, an internationalized error message will be returned instead. -No editing controls (toolbar) will be displayed in the Asset output, even if Admin is turned on. +Editing controls (toolbar) may or may not be displayed in the Asset output, even if Admin is turned on. The Not Found Page may not be Asset Proxied. diff --git a/lib/WebGUI/Shop/Pay.pm b/lib/WebGUI/Shop/Pay.pm index 515a614ff..d404538f0 100644 --- a/lib/WebGUI/Shop/Pay.pm +++ b/lib/WebGUI/Shop/Pay.pm @@ -409,7 +409,7 @@ sub www_selectPaymentGateway { # Complete Transaction if it's a $0 transaction. my $total = $cart->calculateTotal; - if (($total + $cart->calculateShopCreditDeduction($total)) == 0) { + if (sprintf('%.2f', $total + $cart->calculateShopCreditDeduction($total)) eq '0.00') { my $transaction = WebGUI::Shop::Transaction->create($session, {cart => $cart}); $transaction->completePurchase('zero', 'success', 'success'); $cart->onCompletePurchase; diff --git a/lib/WebGUI/i18n/English/Asset_Event.pm b/lib/WebGUI/i18n/English/Asset_Event.pm index 3331fc7c7..0c4e7da64 100644 --- a/lib/WebGUI/i18n/English/Asset_Event.pm +++ b/lib/WebGUI/i18n/English/Asset_Event.pm @@ -35,6 +35,11 @@ our $I18N = { lastUpdated => 1171067211, }, + 'formSynopsis' => { + message => q|HTML form for entering or editing the Event Synopsis.|, + lastUpdated => 1171067211, + }, + 'formLocation' => { message => q|HTML form for entering or editing the Event Location.|, lastUpdated => 1171067211, @@ -695,6 +700,127 @@ be useful, others may not.|, lastUpdated => 1204668000, }, + 'No specific time' => { + message => q{No specific time (all day event)}, + lastUpdated => 1257188155, + }, + + 'Specific start/end time' => { + message => q{Specific start/end time}, + lastUpdated => 1257188155, + }, + + 'day' => { + message => q{day}, + lastUpdated => 1257188155, + }, + + 'Daily' => { + message => q{Daily}, + lastUpdated => 1257188155, + context => q{An event that occurs every day}, + }, + + 'Weekday(s)' => { + message => q{Weekday(s)}, + lastUpdated => 1257188155, + context => q{May occur on one or more weekdays (Monday through Friday)}, + }, + + 'Weekly' => { + message => q{Weekly}, + lastUpdated => 1257188155, + }, + + 'Monthly' => { + message => q{Monthly}, + lastUpdated => 1257188155, + }, + + 'Yearly' => { + message => q{Yearly}, + lastUpdated => 1257188155, + }, + + 'first' => { + message => q{first}, + lastUpdated => 1257188155, + }, + + 'second' => { + message => q{second}, + lastUpdated => 1257188155, + }, + + 'third' => { + message => q{third}, + lastUpdated => 1257188155, + }, + + 'fourth' => { + message => q{fourth}, + lastUpdated => 1257188155, + }, + + 'last' => { + message => q{last}, + lastUpdated => 1257188155, + }, + + 'of' => { + message => 'of', + lastUpdated => 0, + }, + + 'No end' => { + message => 'No end', + lastUpdated => 0, + }, + + 'By date' => { + message => 'By date', + lastUpdated => 0, + }, + + 'After' => { + message => 'After', + lastUpdated => 0, + }, + + 'occurences' => { + message => 'occurences', + lastUpdated => 0, + }, + + 'Every' => { + message => 'Every', + lastUpdated => 0, + }, + + 'Every N weeks on' => { + message => 'Every %s week(s) on', + lastUpdated => 0, + context => '%s is filled with an HTML Form control', + }, + + 'Every N months on' => { + message => 'Every %s month(s) on', + lastUpdated => 0, + context => '%s is filled with an HTML Form control', + }, + + 'Every N years on' => { + message => 'Every %s year(s) on', + lastUpdated => 0, + context => '%s is filled with an HTML Form control', + }, + + 'week on' => { + message => 'week on', + lastUpdated => 0, + context => 'follows a select list with ordinals, first, second, etc. To form the phrase, First week on, Second week on', + }, + }; 1; diff --git a/t/Asset/AssetLineage.t b/t/Asset/AssetLineage.t index 4ea371595..f03192212 100644 --- a/t/Asset/AssetLineage.t +++ b/t/Asset/AssetLineage.t @@ -17,7 +17,7 @@ use WebGUI::Session; use WebGUI::User; use WebGUI::Asset; -use Test::More tests => 90; # increment this value for each test you create +use Test::More tests => 92; # increment this value for each test you create use Test::Deep; # Test the methods in WebGUI::AssetLineage @@ -388,16 +388,19 @@ my $snippet4 = WebGUI::Asset->newByLineage($session, $snippets[4]->get('lineage' is ($snippet4->getId, $snippets[4]->getId, 'newByLineage returns correct Asset'); $snippet4 = WebGUI::Asset->newByLineage($session, $snippets[4]->get('lineage')); -is ($snippet4->getId, $snippets[4]->getId, 'newByLineage: cached lookup'); +is ($snippet4->getId, $snippets[4]->getId, '... cached lookup'); my $cachedLineage = $session->stow->get('assetLineage'); delete $cachedLineage->{$snippet4->get('lineage')}->{id}; my $snippet4 = WebGUI::Asset->newByLineage($session, $snippets[4]->get('lineage')); -is ($snippet4->getId, $snippets[4]->getId, 'newByLineage: failing id cache forces lookup'); +is ($snippet4->getId, $snippets[4]->getId, '... failing id cache forces lookup'); delete $cachedLineage->{$snippet4->get('lineage')}->{class}; my $snippet4 = WebGUI::Asset->newByLineage($session, $snippets[4]->get('lineage')); -is ($snippet4->getId, $snippets[4]->getId, 'newByLineage: failing class cache forces lookup'); +is ($snippet4->getId, $snippets[4]->getId, '... failing class cache forces lookup'); + +is(WebGUI::Asset->newByLineage($session, 'notALineage'), undef, '... returns undef'); +ok(!exists $session->stow->get('assetLineage')->{assetLineage}, '... no entry for the bad lineage in stow'); #################################################### # diff --git a/t/Asset/Wobject/EventManagementSystem.t b/t/Asset/Wobject/EventManagementSystem.t index 69c6cf202..1bc2393db 100644 --- a/t/Asset/Wobject/EventManagementSystem.t +++ b/t/Asset/Wobject/EventManagementSystem.t @@ -222,6 +222,7 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } ); 'isPackage' => ignore(), 'usePackedHeadTags' => ignore(), 'encryptPage' => ignore(), + 'eventMetaData' => ignore(), 'tagId' => ignore(), 'seatsAvailable' => '5', 'revisedBy' => ignore(), @@ -263,6 +264,7 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } ); 'usePackedHeadTags' => ignore(), 'encryptPage' => ignore(), 'tagId' => ignore(), + 'eventMetaData' => ignore(), 'seatsAvailable' => '3', 'revisedBy' => ignore(), 'isExportable' => ignore(), diff --git a/t/AssetAspect/RssFeed.t b/t/AssetAspect/RssFeed.t index a97182a90..466372e96 100644 --- a/t/AssetAspect/RssFeed.t +++ b/t/AssetAspect/RssFeed.t @@ -103,7 +103,7 @@ cmp_deeply( methods( title => 'Dummy Title', description => 'Dummy Synopsis', ##Not description - link => '/home/shawshank', + link => $session->url->getSiteURL . '/home/shawshank', copyright => undef, ), '... title, description, link inherit from asset by default, copyright unset' @@ -139,7 +139,7 @@ cmp_deeply( methods( title => 'Rita Hayworth and the Shawshank Redemption', description => 'A good movie, providing loads of testing collateral', - link => '/home/shawshank', + link => $session->url->getSiteURL . '/home/shawshank', copyright => 'copyright 2009 Plain Black Corporation', ), '... feed settings override asset defaults, copyright'