[interchange] Fix broken ContentEditor references to missing lexical $table

Jon Jensen <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit e93cb97425fe113f4087909769bf98f28ef6ba89
Author: Jon Jensen <[email protected]>
Date:   Fri Jul 12 14:12:15 2013 +0100

    Fix broken ContentEditor references to missing lexical $table
    
    Shockingly, this has been broken since this commit:
    
    commit 13dcf431683126dc0ab2fef865a9c5061081cb88
    Author: Mike Heins <[email protected]>
    Date:   Fri Sep 13 20:46:21 2002 +0000
    
    But Perl didn't notice it until version 5.18.0, where it throws many
    errors like this at Interchange startup time:
    
    Calling UI...UserTag 'content_modify' subroutine failed compilation:
    
            Global symbol "$table" requires explicit package name at [...]

 dist/lib/UI/ContentEditor.pm |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/dist/lib/UI/ContentEditor.pm b/dist/lib/UI/ContentEditor.pm
index 6038cb0..e901104 100644
--- a/dist/lib/UI/ContentEditor.pm
+++ b/dist/lib/UI/ContentEditor.pm
@@ -756,7 +756,7 @@ sub read_template {
 			my $q = join " ", @atoms;
 			my $ary = $db->query({ sql => $q, hashref => 1 });
 			for(@$ary) {
-				push @data, [ $_->{comp_text}, "$table::$spec" ];
+				push @data, [ $_->{comp_text}, "$tname::$spec" ];
 			}
 		}
 	}
@@ -884,7 +884,7 @@ sub read_component {
 			my $q = join " ", @atoms;
 			my $ary = $db->query({ sql => $q, hashref => 1 });
 			for(@$ary) {
-				push @data, [ $_->{comp_text}, "$table::$spec" ];
+				push @data, [ $_->{comp_text}, "$tname::$spec" ];
 			}
 		}
 	}
@@ -1146,7 +1146,7 @@ sub available_components {
 		my $q = join " ", @atoms;
 		my $ary = $db->query({ sql => $q, hashref => 1 });
 		for(@$ary) {
-			push @data, [ $_->{comp_text}, "$table::$_->{code}" ];
+			push @data, [ $_->{comp_text}, "$tname::$_->{code}" ];
 		}
 	}
 	my @out;
@@ -1201,7 +1201,7 @@ sub available_templates {
 		my $q = join " ", @atoms;
 		my $ary = $db->query({ sql => $q, hashref => 1 });
 		for(@$ary) {
-			push @data, [ $_->{comp_text}, "$table::$_->{code}" ];
+			push @data, [ $_->{comp_text}, "$tname::$_->{code}" ];
 		}
 	}
 	my @out;
@@ -1333,7 +1333,7 @@ sub read_page {
 		my $q = join " ", @atoms;
 		my $ary = $db->query({ sql => $q, hashref => 1 });
 		for(@$ary) {
-			push @data, [ $_->{comp_text}, "$table::$spec" ];
+			push @data, [ $_->{comp_text}, "$tname::$spec" ];
 		}
 	}
 	else {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.