From d32fa80155eb518a00233582a212bb8905ea44f9 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 9 Jun 2008 22:11:44 +0000 Subject: [PATCH] Handle autocommit of products from the settings. Tweak an error message. Showing the file isn't that useful. --- lib/WebGUI/Shop/Products.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Shop/Products.pm b/lib/WebGUI/Shop/Products.pm index 7e8739522..aacef2181 100644 --- a/lib/WebGUI/Shop/Products.pm +++ b/lib/WebGUI/Shop/Products.pm @@ -273,8 +273,7 @@ sub www_importProducts { }; my ($exception, $status_message); if ($exception = Exception::Class->caught('WebGUI::Error::InvalidFile')) { - $status_message = sprintf 'A problem was found with your file: %s, %s', - $exception->brokenFile, + $status_message = sprintf 'A problem was found with your file: %s', $exception->error; if ($exception->brokenLine) { $status_message .= sprintf ' on line %d', $exception->brokenLine; @@ -286,6 +285,21 @@ sub www_importProducts { else { my $i18n = WebGUI::International->new($session, 'Shop'); $status_message = $i18n->get('import successful'); + ##Copy and paste from Asset.pm, www_editSave + if ($self->session->setting->get("autoRequestCommit")) { + # Make sure version tag hasn't already been committed by another process + my $versionTag = WebGUI::VersionTag->getWorking($self->session, "nocreate"); + + if ($versionTag && $self->session->setting->get("skipCommitComments")) { + $versionTag->requestCommit; + } + elsif ($versionTag) { + $self->session->http->setRedirect( + $self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId) + ); + return undef; + } + } } return $self->www_manage($status_message); }