diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b1c5bdd73..03cfb8aa1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.7.17 + - fixed #10654: Story Archive: Search not working properly 7.7.16 - fixed #10590: Session::DateTime->secondsToInterval doesn't allow 7 weeks diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index 2645cab9d..49cf0ab4b 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -78,7 +78,7 @@ sub addRevision { my $newPhotoData = $newSelf->duplicatePhotoData; $newSelf->setPhotoData($newPhotoData); - $newSelf->requestAutoCommit; + #$newSelf->requestAutoCommit; return $newSelf; } @@ -607,8 +607,8 @@ sub processPropertiesFromFormPost { my $session = $self->session; $self->next::method; my $archive = delete $self->{_parent}; ##Force a new lookup. - $session->log->warn($self->getParent->get('className')); - $session->log->warn($self->getParent->getParent->get('className')); + #$session->log->warn($self->getParent->get('className')); + #$session->log->warn($self->getParent->getParent->get('className')); my $form = $session->form; ##Handle old data first, to avoid iterating across a newly added photo. my $photoData = $self->getPhotoData; @@ -824,6 +824,7 @@ Extend the superclass to make sure that the asset always stays hidden from navig sub update { my $self = shift; my $properties = shift; + #$self->session->log->warn('story update'); return $self->next::method({%$properties, isHidden => 1}); } diff --git a/t/Asset/Story.t b/t/Asset/Story.t index d840055f4..a24745c7d 100644 --- a/t/Asset/Story.t +++ b/t/Asset/Story.t @@ -130,6 +130,7 @@ is($story->get('isHidden'), 1, 'by default, stories are hidden'); $story->update({isHidden => 0}); is($story->get('isHidden'), 1, 'stories cannot be set to not be hidden'); is($story->get('state'), 'published', 'Story is published'); +$story->requestAutoCommit; { ##Version control does not alter the current object's status, fetch an updated copy from the diff --git a/t/Asset/Wobject/StoryArchive.t b/t/Asset/Wobject/StoryArchive.t index 5a5d0b7e7..badf39166 100644 --- a/t/Asset/Wobject/StoryArchive.t +++ b/t/Asset/Wobject/StoryArchive.t @@ -160,6 +160,7 @@ my $child = $archive->addChild({className => 'WebGUI::Asset::Wobject::StoryTopic is($child, undef, 'addChild: Will only add Stories'); $child = $archive->addChild({className => 'WebGUI::Asset::Story', title => 'First Story'}); +$child->requestAutoCommit; isa_ok($child, 'WebGUI::Asset::Story', 'addChild added and returned a Story'); is($archive->getChildCount, 1, 'addChild: added it to the archive'); my $folder = $archive->getFirstChild(); @@ -195,6 +196,7 @@ my ($yesterdayMorn,undef) = $session->datetime->dayStartEnd($yesterday); my $story = $oldFolder->addChild({ className => 'WebGUI::Asset::Story', title => 'WebGUI is released', keywords => 'roger,foxtrot,echo'}); $creationDateSth->execute([$wgBday, $story->getId]); +$story->requestAutoCommit; { my $storyDB = WebGUI::Asset->newByUrl($session, $story->getUrl); @@ -203,6 +205,7 @@ $creationDateSth->execute([$wgBday, $story->getId]); my $pastStory = $newFolder->addChild({ className => 'WebGUI::Asset::Story', title => "Yesterday is history" }); $creationDateSth->execute([$yesterday, $pastStory->getId]); +$pastStory->requestAutoCommit; my $templateVars; $templateVars = $archive->viewTemplateVariables(); @@ -276,6 +279,9 @@ foreach my $storilet ($story2, $story3, $story4) { $session->db->write("update asset set creationDate=$now where assetId=?",[$storilet->getId]); } $archive->update({storiesPerPage => 3}); +$story2->requestAutoCommit; +$story3->requestAutoCommit; +$story4->requestAutoCommit; ##Don't assume that Admin and Visitor have the same timezone. $session->user({userId => 3}); diff --git a/t/Asset/Wobject/StoryTopic.t b/t/Asset/Wobject/StoryTopic.t index bf24e09d4..acc029932 100644 --- a/t/Asset/Wobject/StoryTopic.t +++ b/t/Asset/Wobject/StoryTopic.t @@ -54,6 +54,7 @@ my $creationDateSth = $session->db->prepare('update asset set creationDate=? whe my $pastStory = $newFolder->addChild({ className => 'WebGUI::Asset::Story', title => "Yesterday is history", keywords => 'andy,norton'}); $creationDateSth->execute([$yesterday, $pastStory->getId]); +$pastStory->requestAutoCommit; my @staff = qw/norton hadley mert trout/; my @inmates = qw/bogs red brooks andy heywood tommy jake skeet/; @@ -66,6 +67,7 @@ STORY: foreach my $name (@characters) { my $namedStory = $nowFolder->addChild({ className => 'WebGUI::Asset::Story', title => $name, keywords => $name, } ); $storyHandler->{$name} = $namedStory; $creationDateSth->execute([$now, $namedStory->getId]); + $namedStory->requestAutoCommit; } $storyHandler->{bogs}->update({subtitle => 'drinking his food through a straw'});