[wellwell-devel] [wellwell/zoom] Add check to [zoom] for proper table specifications.

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Mon Sep 13 11:30:57 UTC 2010


commit 1f2eff7dccc4cc5360f64da5036515e7a9720f69
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Mon Sep 13 13:29:35 2010 +0200

    Add check to [zoom] for proper table specifications.

 lib/WellWell/Zoom.pm |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/lib/WellWell/Zoom.pm b/lib/WellWell/Zoom.pm
index f8d21d2..3068ce1 100644
--- a/lib/WellWell/Zoom.pm
+++ b/lib/WellWell/Zoom.pm
@@ -64,12 +64,20 @@ sub zoom {
 		$bref->{query_is_sql} = 1;
 
 		# now determine which fields are needed
+		my %tables;
+		
 		while (($key, $value) = each %{$sref->{params}->{$name}->{hash}}) {
 			if (exists $value->{table}) {
+				$tables{$value->{table}} = 1;
 				push @{$bref->{columns}->{$value->{table}}}, $value->{field} || $key;
 			}
 		}
 
+		unless (keys %tables) {
+			Vend::Tags->error({name => 'zoom', set => 'Missing tables in specification.'});
+			return;
+		}
+		
 		($sql, $bind) = build_select(%$bref);
 
 		$sth = $bref->{dbh}->prepare($sql);



More information about the wellwell-devel mailing list