C4::Circulation - ensure that certain modules always get imported
authorGalen Charlton <galen.charlton@liblime.com>
Fri, 4 Jan 2008 00:43:39 +0000 (18:43 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 4 Jan 2008 02:24:09 +0000 (20:24 -0600)
For some reason currently unclear to me, a use 'C4::XXX' does
not seem to guarantee that the contents of C4::XXX's
@EXPORT gets imported into C4::Circulation's symbol table.

Added an INIT block to ensure that this gets done as
part of runtime initialization.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Circulation.pm

index f6505b6..09cf45f 100644 (file)
@@ -43,6 +43,22 @@ use C4::Log; # logaction
 
 use Data::Dumper;
 
+INIT {
+    # an ugly hack to ensure that 
+    # various subs get imported
+    # into C4::Circulation's symbol table
+    # FIXME: hopefully can remove once
+    #        we get a better idea of exactly
+    #        how Exporter/use/require/import
+    #        should be used with modules
+    #        that currently call functions
+    #        from each other.
+    import C4::Items;
+    import C4::Members;
+    import C4::Reserves;
+    import C4::Overdues;
+}
+
 our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,%EXPORT_TAGS);
 
 # set the version for version checking