[interchange-cvs] [SCM] Interchange branch, master, updated. 03839246e989f0eac072e56179d6dd55909ea3f9

Peter Ajamian interchange-cvs at icdevgroup.org
Tue Sep 15 07:54:19 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange".

The branch, master has been updated
       via  03839246e989f0eac072e56179d6dd55909ea3f9 (commit)
       via  6eac1eba9fa74165547e1fe966aa70c67f412986 (commit)
       via  90a4b6a82de15bae66c75015abf3cb46f8086851 (commit)
       via  a971ab00ea3bf69e549aeed001806f382aab7bc8 (commit)
       via  00a20b210ed8ae9f56f579da8b426508f224246e (commit)
      from  f8ea27b275923fbb58d3b561fa81f17ca7354859 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 03839246e989f0eac072e56179d6dd55909ea3f9
Merge: 6eac1eba9fa74165547e1fe966aa70c67f412986 f8ea27b275923fbb58d3b561fa81f17ca7354859
Author: Peter Ajamian <peter at pajamian.dhs.org>
Date:   Tue Sep 15 00:44:51 2009 -0700

    Merge branch 'master' of git://github.com/interchange/interchange

commit 6eac1eba9fa74165547e1fe966aa70c67f412986
Author: Peter Ajamian <peter at pajamian.dhs.org>
Date:   Tue Sep 15 00:39:18 2009 -0700

    flypage SpecialSub changes.
    
    * Revert behavior in the case where the return value is a hashref.
    
    * A return value of undef explicitly states that we should not process a
      flypage.
    
    On 08/31/2009 01:54 PM, Mike Heins wrote:
    > Quoting Peter (peter at pajamian.dhs.org):
    >> On 08/31/2009 12:01 PM, Mike Heins wrote:
    >>> Quoting Jon Jensen (jon at endpoint.com):
    >>>> It looks more reasonable to me than the old code, but the behavior doesn't
    >>>> quite look compatible. Before, $base could be assigned an arbitrary result
    >>>> hashref and thus could be used for a different kind of on-the-fly product,
    >>>> but now it seems the product code has to actually exist in a real
    >>>> database.
    >>> Good point.
    >>>
    >>>> I am not using that feature and don't object to the change, but I thought
    >>>> I'd point out the different behavior.
    >>> Now that I think about it, it was designed to handle OnFly products so the
    >>> change doesn't make sense.
    >> Ok, well that's why I asked.  How about we keep the old code if the
    >> return is a hashref, but if it's just a text scalar which contains a sku
    >> then get $base from product_code_exists_ref()?
    >
    > I think that works.
    >
    >> Also just to give an explicit way to say, "don't display a flypage for
    >> this" a return of undef could result in the flypage being skipped as
    >> if the sku doesn't exist?
    >
    > Yes.

commit 90a4b6a82de15bae66c75015abf3cb46f8086851
Merge: a971ab00ea3bf69e549aeed001806f382aab7bc8 2ced36a3c2e651194bdb1a352727f834eeae8fee
Author: Peter Ajamian <peter at pajamian.dhs.org>
Date:   Sun Sep 13 14:39:07 2009 -0700

    Merge branch 'master' of git://github.com/interchange/interchange
    
    Conflicts:
    	WHATSNEW-5.7 ... MANUALLY RESOLVED

commit a971ab00ea3bf69e549aeed001806f382aab7bc8
Author: Peter Ajamian <peter at pajamian.dhs.org>
Date:   Fri Aug 28 08:02:45 2009 -0700

    New area_page SpecialSub.
    
    New area_page SpecialSub that allows you to change the page name passed to the
    [area] tag before the tag processes the page name.

commit 00a20b210ed8ae9f56f579da8b426508f224246e
Author: Peter Ajamian <peter at pajamian.dhs.org>
Date:   Fri Aug 28 07:03:56 2009 -0700

    flypage SpecialSub fix for non-existent SKUs.
    
    If the flypge SpecialSub returned a non-existent SKU then a blank flypage would
    be displayed (with no data).  This is now fixed so that there is no difference
    to what happens without a SpecialSub.

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

Summary of changes and diff:
 WHATSNEW-5.7            |    7 +++++++
 lib/Vend/Interpolate.pm |   25 +++++++++++++++++++++----
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/WHATSNEW-5.7 b/WHATSNEW-5.7
index d999b5a..16ad884 100755
--- a/WHATSNEW-5.7
+++ b/WHATSNEW-5.7
@@ -385,6 +385,13 @@ Core
   because Getopt::Long ignores option case by default. This fixes the problem
   by passing the no_ignore_case config parameter to Getopt::Long.
 
+* If the flypge SpecialSub returned a non-existent SKU then a blank flypage
+  would be displayed (with no data).  This is now fixed so that there is no
+  difference to what happens without a SpecialSub.
+
+* New area_page SpecialSub that allows you to change the page name passed to the
+  [area] tag before the tag processes the page name.
+
 * Various UTF-8 support fixes.
 
 * Add NoBlankLines option to and clean up error HTML in Interchange::Link.
diff --git a/lib/Vend/Interpolate.pm b/lib/Vend/Interpolate.pm
index 9dad66c..ae07ba6 100644
--- a/lib/Vend/Interpolate.pm
+++ b/lib/Vend/Interpolate.pm
@@ -2683,7 +2683,7 @@ sub tag_area {
 		$Vend::Session->{$aloc}{$page} = $opt->{alias};
 	}
 
-	my $r;
+	my ($r, $subname);
 
 	if ($opt->{search}) {
 		$page = escape_scan($opt->{search});
@@ -2718,6 +2718,13 @@ sub tag_area {
 		undef $arg;
 	}
 
+	elsif ($subname = $Vend::Cfg->{SpecialSub}{areapage}) {
+            my $sub = $Vend::Cfg->{Sub}{$subname} || $Global::GlobalSub->{$subname};
+            my $newpage = $sub->($page, $opt);
+            $page = $newpage if defined $newpage;
+            $arg = $opt->{arg};
+        }
+
 	$urlroutine = $opt->{secure} ? \&secure_vendUrl : \&vendUrl;
 
 	return $urlroutine->($page, $arg, undef, $opt);
@@ -4955,12 +4962,22 @@ sub fly_page {
 	if ($subname = $Vend::Cfg->{SpecialSub}{flypage}) {
 		my $sub = $Vend::Cfg->{Sub}{$subname} || $Global::GlobalSub->{$subname}; 
 		$listref = $sub->($code);
-		$listref = { mv_results => [[$listref]] } unless ref($listref);
-		$base = $listref;
+
+		return unless defined $listref;
+
+		if (ref $listref) {
+			$base = $listref;
+		}
+
+		else {
+			$code = $listref;
+			$listref = { mv_results => [[$listref]] };
+			$base = product_code_exists_ref($code);
+		}
 	}
 	else {
-		$base = product_code_exists_ref($code);
 		$listref = {mv_results => [[$code]]};
+		$base = product_code_exists_ref($code);
 	}
 	
 #::logDebug("fly_page: code=$code base=$base page=" . substr($page, 0, 100));


hooks/post-receive
-- 
Interchange



More information about the interchange-cvs mailing list