[ic] Util::find_special_page() OR logic seems backwards

John Young john_young at sonic.net
Tue Mar 30 20:06:36 EST 2004


5.1.0-200403290658 Util.pm contains:

> # Checks the Locale for a special page definintion mv_special_$key and
> # returns it if found, otherwise goes to the default Vend::Cfg->{Special} array
> sub find_special_page {
>     my $key = shift;
>   my $dir = '';
>   $dir = "../$Vend::Cfg->{SpecialPageDir}/"
>     if $Vend::Cfg->{SpecialPageDir};
>     return $Vend::Cfg->{Special}{$key} || "$dir$key";
> }

The comment above the sub seems to counter the "||" logic.  Should
the "||" be flipped, as in:

> sub find_special_page {
>     my $key = shift;
>     return "../$Vend::Cfg->{SpecialPageDir}/$key" if $Vend::Cfg->{SpecialPageDir};
>     return $Vend::Cfg->{Special}{$key};
> }

This issue manifested itself because I keep my flypage in SpecialPageDir.
It is not found with the stock Util.pm, but does function with my patch (in
earlier versions I used "SpecialPage  flypage  ../special_pages/flypage" in
catalog.cfg -- which worked, even with "NoAbsolute yes" -- 5.1 is more
strict with NoAbsolute, but I don't think the SpecialPage is required
in this case as IC will find the file anyway).

If the change above makes sense, following is a patch.

Thanks!
John Young

-------- snip --------

--- Util.pm.orig	Sat Mar  6 19:14:41 2004
+++ Util.pm	Tue Mar 30 16:47:47 2004
@@ -1554,14 +1554,12 @@
  }


-# Checks the Locale for a special page definintion mv_special_$key and
+# Checks the Locale for a special page definition mv_special_$key and
  # returns it if found, otherwise goes to the default 
Vend::Cfg->{Special} array
  sub find_special_page {
      my $key = shift;
-	my $dir = '';
-	$dir = "../$Vend::Cfg->{SpecialPageDir}/"
-		if $Vend::Cfg->{SpecialPageDir};
-    return $Vend::Cfg->{Special}{$key} || "$dir$key";
+    return "../$Vend::Cfg->{SpecialPageDir}/$key" if 
$Vend::Cfg->{SpecialPageDir};
+    return $Vend::Cfg->{Special}{$key};
  }

  ## ERROR



More information about the interchange-users mailing list