[Rt-commit] rt branch, 4.0/fix-overlay-imports, created. rt-4.0.0rc8-2-gd17ec96

Thomas Sibley trs at bestpractical.com
Thu Apr 21 17:30:42 EDT 2011


The branch, 4.0/fix-overlay-imports has been created
        at  d17ec966aaa133563acc6742c80559ff42095953 (commit)

- Log -----------------------------------------------------------------
commit d9f6bba062815e698298f6bd04fe312647123011
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Apr 21 17:16:13 2011 -0400

    Ensure we try to load RT::Interface::Web_(Overlay|Local|Vendor).pm
    
    This was broken because RT/Interface/Web.pm declares package
    HTML::Mason::Commands before the _ImportOverlays call.  Other packages
    don't seem to be similarly broken, and we have a better solution in mind
    for 4.2.
    
    As an aside: the new overlay loading requires that you declare a package
    in your overlay (otherwise you're in the RT::Base package).  There's no
    clean way to require a file in the context of a specific package without
    hardcoding the package name, so we can't just fix _ImportOverlays to
    declare a package for you.
    
    See ticket #17170 and http://lists.bestpractical.com/pipermail/rt-devel/2011-April/011446.html

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 9b0ce4a..bfdc245 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2756,6 +2756,7 @@ sub _NewScrubber {
     return $scrubber;
 }
 
+package RT::Interface::Web;
 RT::Base->_ImportOverlays();
 
 1;

commit d17ec966aaa133563acc6742c80559ff42095953
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Apr 21 17:19:04 2011 -0400

    Don't shove stuff into $_ which might get used later and cause read-only warnings
    
    This is particularly relevant since it gets called early in server
    startup.

diff --git a/lib/RT/Base.pm b/lib/RT/Base.pm
index e2de668..3c209f2 100644
--- a/lib/RT/Base.pm
+++ b/lib/RT/Base.pm
@@ -156,8 +156,8 @@ sub _ImportOverlays {
     my $class = shift;
     my ($package,undef,undef) = caller();
     $package =~ s|::|/|g;
-    for (qw(Overlay Vendor Local)) {
-        my $filename = $package."_".$_.".pm";
+    for my $type (qw(Overlay Vendor Local)) {
+        my $filename = $package."_".$type.".pm";
         eval { require $filename };
         die $@ if ($@ && $@ !~ m{^Can't locate $filename});
     }

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


More information about the Rt-commit mailing list