[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. 2b43316d5606217fdad42ec7a9e5f8a9b2fd976c

Stefan Hornburg racke at rt.icdevgroup.org
Wed May 6 09:19:31 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  2b43316d5606217fdad42ec7a9e5f8a9b2fd976c (commit)
       via  ef92a900d3f63e76e35b7cc15a04ef4951585215 (commit)
      from  b039fcf7f78e17d97cf1f67f8a77eff2a74553d1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2b43316d5606217fdad42ec7a9e5f8a9b2fd976c
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Wed May 6 11:19:19 2009 +0200

    require name

commit ef92a900d3f63e76e35b7cc15a04ef4951585215
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Wed May 6 11:19:01 2009 +0200

    only take public reviews into account

-----------------------------------------------------------------------

Summary of changes and diff:
 plugins/reviews/code/reviews.tag |    4 +++-
 plugins/reviews/profiles/reviews |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plugins/reviews/code/reviews.tag b/plugins/reviews/code/reviews.tag
index 5dfc452..70e6b71 100644
--- a/plugins/reviews/code/reviews.tag
+++ b/plugins/reviews/code/reviews.tag
@@ -38,7 +38,9 @@ sub {
 		$code = $Db{reviews}->set_slice('', %review);
 
 		# calculate average rating
-		$ret = $Db{products}->query(q{update products set rating = (select sum(rating)/count(rating) from reviews where sku = '%s') where sku = '%s'}, $review{sku}, $review{sku});
+		if ($review{public}) {
+			$ret = $Db{products}->query(q{update products set rating = (select sum(rating)/count(rating) from reviews where sku = '%s' and public is TRUE) where sku = '%s'}, $review{sku}, $review{sku});
+		}
 
 		return $code;
 	}
diff --git a/plugins/reviews/profiles/reviews b/plugins/reviews/profiles/reviews
index f64d9bd..68be409 100644
--- a/plugins/reviews/profiles/reviews
+++ b/plugins/reviews/profiles/reviews
@@ -1,4 +1,5 @@
 __NAME__ reviews
+name=required [L]Please enter a name.[/L]
 rating=natural [L]Please select a rating.[/L]
 title=required [L]Please enter review title.[/L]
 review=required [L]Please enter your review.[/L]


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list