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

John Young john_young at sonic.net
Tue Mar 30 21:54:18 EST 2004

I wrote:
> 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).

Well, once again I have posted without testing to the extent I
should have.  Please ignore my change above, as it potentially
breaks other SpecialPage settings -- such as one for 'order'
where the file still resides under 'pages/'.

I'm still working on simultaneously using the following:

SpecialPage  flypage  ../special_pages/flypage
SpecialPage  order    order_related_subdirectory/shopping_cart.html
NoAbsolute   Yes      # (in interchange.cfg, of course).

If someone knows of a way to do that without editing the core to add
something similar to AllowedFileRegex (to allow for an exception to
'NoAbsolute Yes') then please let me know.

Thanks, and my apologies for the inadequately tested patch!
John Young

More information about the interchange-users mailing list