Skip to content
Browse files

Make global ActionMap input consistent with catalog ActionMaps (RT #48).

This will break all global ActionMaps that expect the old calling
parameter of a URL with the action removed from the beginning.

I've manually reviewed all of the built-in global ActionMaps, and tested
some of them, and found no problems. But I won't be surprised if some
problems are found. More testing is warranted.
  • Loading branch information...
1 parent cd5a068 commit 9b035fc09b617fa5c1de6422ddf2481af4ac729e @jonjensen jonjensen committed Apr 22, 2008
Showing with 36 additions and 16 deletions.
  1. +28 −8 UPGRADE
  2. +0 −1 dist/catalog_after.cfg
  3. +2 −0 dist/lib/UI/ui.cfg
  4. +6 −7 lib/Vend/Dispatch.pm
View
36 UPGRADE
@@ -4,14 +4,13 @@
Interchange is designed to be drop-in compatible in its major version.
-
- 5.6.x -- A number of incompatible changes were made. Most of them will be
- simple to deal with, but please consult the list below in the
- "Known Issues" section.
+Briefly summarized, here's what you can expect when upgrading from the
+following versions:
5.4.x -- A number of incompatible changes were made. Most of them will be
simple to deal with, but please consult the list below in the
- "Known Issues" section.
+ "Known Issues" section. Your code will almost certainly fail to
+ work properly until you make the necessary changes described!
5.2.x -- There should be few to no compatibility issues in
upgrading from Interchange 5.2.x.
@@ -81,6 +80,10 @@ SpecialSub catalog_init has been renamed to request_init.
UserTrack now defaults to "no", so if you want the X-Track HTTP response header
to be output, add "UserTrack yes" to your catalog.cfg.
+UserTrack also no longer affects TrackFile, so if you don't want TrackFile
+output, you should not have a TrackFile directive in catalog.cfg.
+
+
KNOWN ISSUES UPGRADING FROM 5.4.x
Check the "special_pages/missing.html" file, in all of your Interchange-driven
@@ -106,9 +109,24 @@ no configuration file line beginning with # will be parsed, including
#ifdef, #include, etc., as was done in the past. Bare ifdef, include, etc.
must now be used.
-Removed RequiredFields, HTMLmirror and UseCode directives.
+Global ActionMaps: Previously, the path passed to a global ActionMap
+did not include the action itself, but the path passed to a catalog
+ActionMap did include the action. This discrepancy was annoying to keep
+track of. Now both kinds of ActionMaps receive a path that includes
+the action. This means that all global ActionMap code will need to be
+updated to deal with the action. Most simply, you can strip off the
+action at the beginning of the sub something like this:
+
+ ActionMap your_action <<EOR
+ sub {
+ my ($path) = @_;
+ # remove action
+ $path =~ s:^[^/]+/::;
+ # your code here
+ }
+ EOR
-Removed unused SOAP_Host directive.
+Removed SOAP_Host, RequiredFields, HTMLmirror and UseCode directives.
All previously deprecated configuration directives have been removed.
@@ -144,8 +162,10 @@ into account when the DomainTail directive is in effect.
The session per IP counters have been changed to the new "timecard" round-robin
style counters. You will need to delete the old counter files from the
tmp/addr_ctr directory with a command similar to the following:
+
rm -rf catroot/tmp/addr_ctr/*
-...be careful with the above command, if mistyped it can seriously mess up
+
+...be careful with the above command. If mistyped it can seriously mess up
your filesystem.
The [error] and [formel] tags now make use of the following CSS class,
View
1 dist/catalog_after.cfg
@@ -57,7 +57,6 @@ ParseVariables Yes
ActionMap ui_download <<EOR
sub {
- my $deliverable = shift;
my $status;
$CGI->{mv_nextpage} =~ s:^ui_download/::;
$CGI->{mv_nextpage} .= $Session->{extension};
View
2 dist/lib/UI/ui.cfg
@@ -149,6 +149,8 @@ ActionMap admin_publish <<EOR
sub {
require HTML::HeadParser;
my $path = shift;
+ # strip action from beginning of path
+ $path =~ s{\A[^/]+/}{};
#::logDebug("Path is $path");
use vars qw/
View
13 lib/Vend/Dispatch.pm
@@ -1,6 +1,6 @@
# Vend::Dispatch - Handle Interchange page requests
#
-# $Id: Dispatch.pm,v 1.98 2008-04-22 05:28:54 jon Exp $
+# $Id: Dispatch.pm,v 1.99 2008-04-22 07:00:01 jon Exp $
#
# Copyright (C) 2002-2008 Interchange Development Group
# Copyright (C) 2002 Mike Heins <mike@perusion.net>
@@ -26,7 +26,7 @@
package Vend::Dispatch;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.98 $, 10);
+$VERSION = substr(q$Revision: 1.99 $, 10);
use POSIX qw(strftime);
use Vend::Util;
@@ -1655,7 +1655,6 @@ EOF
#::logDebug("path=$Vend::FinalPath mv_action=$CGI::values{mv_action}");
DOACTION: {
- my @path = split('/', $Vend::FinalPath, 2);
if (defined $CGI::values{mv_action}) {
$CGI::values{mv_todo} = $CGI::values{mv_action}
if ! defined $CGI::values{mv_todo}
@@ -1665,7 +1664,7 @@ EOF
if ! defined $CGI::values{mv_nextpage};
}
else {
- $Vend::Action = shift @path;
+ ($Vend::Action) = $Vend::FinalPath =~ m{\A([^/]*)};
}
#::logGlobal("action=$Vend::Action path=$Vend::FinalPath");
@@ -1676,15 +1675,15 @@ EOF
if ! defined $CGI::values{mv_nextpage};
new Vend::Parse;
}
- elsif ( defined ($sub = $action{$Vend::Action}) ) {
- $Vend::FinalPath = join "", @path;
+ else {
+ $sub = $action{$Vend::Action};
}
#show_times("end path/action resolve") if $Global::ShowTimes;
eval {
if(defined $sub) {
- $status = $sub->($Vend::FinalPath);
+ $status = $sub->($Vend::FinalPath);
#show_times("end action") if $Global::ShowTimes;
}
else {

0 comments on commit 9b035fc

Please sign in to comment.
Something went wrong with that request. Please try again.