[ic] catalog config error

Aaron Berg ir.gath at gmail.com
Tue May 30 11:24:36 EDT 2006


> The only other thing I can think of is that you got the change regarding
> ConfigParseComments in your development environment and that causes some
> issues with your catalog.cfg ... Change as noted in the WHATSNEW:
> Developer: jon
> Date: 2006-01-30 17:44:11 GMT
> Modified:  debian   interchange.cfg
> Modified:  dist     interchange.cfg.dist
> Modified:  dist/standard catalog.cfg
> Modified:  lib/Vend Config.pm
> Remove global and catalog directives "ConfigParseComments". Its "no"
> behavior is now the only one. That means that #ifdef, #include, and friends
> are now never anything besides comments.
>
> Perhaps showing the catalog.cfg might help shed a light on things.
>
> CU,
>
> Gert

Thanks for the suggestion.  I tried changing the ConfigParseComments
from 'No' to 'Yes' without any effect.  I've done a new copy of the
catalog, which still has issues.  Originally I was getting the same
error in theme.cfg, but removed the inline stylesheet (declared inside
an ifdef) which resolved that. The theme.cfg error is as follows:
------
In line 0 of the configuration file 'templates/foundation/theme.cfg':

catalog_name config error: Failed to close #ifdef on line 18.
In line 0 of the configuration file 'templates/foundation/theme.cfg':
-----

If I remove the content of this ifdef that theme.cfg error goes away
and I'm given the catalog.cfg line 74 error.  Line 74 of catalog.cfg
includes dbconf/mysql/mysql.cfg.  Oddly I get the same error if I
delete the ifdef around line 74 and it's contents.

catalog.cfg:
============
#==========================================================================#

# catalog.cfg
# See the 'icconfig' document for details.

#==========================================================================#

# Ignore older C-style directives like #ifdef, #endif, #include.
# This directive affects the entire catalog configuration.
ConfigParseComments No

# Read in initial variables from a database.
VariableDatabase variable

# Read in site-specific variables from a database (if any).
# Used to create a information for a transferred catalog
VariableDatabase site

#==========================================================================#

# Allow a template to drop in some beginning config.
include etc/before.cfg

#==========================================================================#

# Warn if any important modules or usertags are missing.

Require module Digest::MD5    "Need %s %s for better cache keys."
Require module Safe::Hole
Require module LWP::Simple

Require UserTag   email email_raw var loc table_editor button component

#==========================================================================#

# Can send various files outside the catalog directory, for disk partition
# reasons, for example.

ParseVariables  Yes

ifdef LOGDIR
ErrorFile       __LOGDIR__/error.log
AsciiTrack      __LOGDIR__/tracking.asc
TrackFile       __LOGDIR__/usertrack
endif

ifndef LOGDIR
AsciiTrack      logs/tracking.asc
TrackFile       logs/usertrack
endif

ifdef CACHEDIR
SessionDatabase __CACHEDIR__/session
ScratchDir      __CACHEDIR__/tmp
endif

ifndef CACHEDIR
SessionDatabase session
ScratchDir      tmp
endif

#==========================================================================#

# Database setup

ParseVariables  Yes

ifndef SQLDSN
Variable  SQLDSN  dbi:mysql:icdb_adaptive
endif

ifdef MYSQL
DatabaseDefault NO_ASCII_INDEX 1
include dbconf/mysql/mysql.cfg
endif

ifdef PGSQL
DatabaseDefault NO_ASCII_INDEX 1
include dbconf/pgsql/pgsql.cfg
endif

ifdef ORACLE
DatabaseDefault NO_ASCII_INDEX 1
include dbconf/oracle/oracle.cfg
endif

ifdef SQLITE
DatabaseDefault NO_ASCII_INDEX 1
include dbconf/sqlite/sqlite.cfg
endif

# Default DBM if nothing else defined
ifndef SOME_DATABASE
include dbconf/default_db/default_db.cfg
endif

#==========================================================================#

# The URLs which are written to refer back to our catalog.

ParseVariables  Yes

VendURL    http://__SERVER_NAME____CGI_URL__
SecureURL  __SECURE_SERVER____CGI_URL__

ifndef SECURE_ENABLE
SecureURL  http://__SERVER_NAME____CGI_URL__
endif

# Set the image path for relative images
ImageDir          __IMAGE_DIR__/
ImageDirInternal  http://__SERVER_NAME____IMAGE_DIR__/

## This is put in so Mozilla's brain-dead composer refetch function won't fail
DeliverImage  yes

#==========================================================================#

# Here we set up the catalog theme.

ParseVariables Yes

ifndef STYLE
Variable STYLE default
endif
include templates/__STYLE__/theme.cfg

# Provide some links for the admin to edit pages
Autoload admin_links

#==========================================================================#

# Internationalization
LocaleDatabase  locale

# Default locale
ifdef DEFAULT_LOCALE
DefaultLocale	__DEFAULT_LOCALE__
endif
ifndef DEFAULT_LOCALE
DefaultLocale   en_US
endif

# Database definitions for localized databases
include dbconf/locales/{__LOCALES__}.cfg

#==========================================================================#

# Various catalog settings.

ScratchDefault  mv_add_dot_html   1
ScratchDefault  mv_no_session_id  1
ScratchDefault  mv_no_count       1

DirectoryIndex  index.html
SpecialPage  catalog  index
SpecialPage  report   ../etc/report
SpecialPage  receipt  ../etc/receipt

# Allow others in our group to read/write files by default
ReadPermission  group
WritePermission group

# If a specific user session accesses our catalog more than this many times
# in a 30-second time period. If the limit is exceeded, the LockoutCommand
# (if set) is executed. Set this to 0 if you're getting links to 127.0.0.1
# during your testing.
RobotLimit  0

# Strip whitespace from top of pages so you don't have to scroll down
# before the HTML starts when doing 'view source' in a browser.
Pragma  strip_white

#==========================================================================#

# User session related settings.

# Whether to encrypt passwords in UserDB
# We usually don't for users, so we can mail them their password
# We DO in admin, that is set in catalog_after.cfg
UserDB    default    crypt         0

# Change a field to something that doesn't conflict in MySQL
UserDB    default    time_field    mod_time

# Don't want people setting their credit limit or dealer status directly
UserDB    default    scratch       "dealer price_level credit_limit"

# minimal login stuff for affiliate
UserDB    affiliate  user_field    affiliate
UserDB    affiliate  database      affiliate
UserDB    affiliate  time_field    none
UserDB    affiliate  crypt         0

# Set this to Yes if you want auto-login capability for users.
# You must be careful about malicious JavaScripts in your embedded code.
CookieLogin  No

# Limit the time your customers can CookieLogin
SaveExpire   3 days

#==========================================================================#

# Cart, order, and route settings.

ParseVariables  Yes

ValuesDefault   country      __SHIP_DEFAULT_COUNTRY__
ValuesDefault   mv_shipmode  __SHIP_DEFAULT_MODE__
DefaultShipping __SHIP_DEFAULT_MODE__

MailOrderTo     __ORDERS_TO__

AlwaysSecure    ord/multi ord/country ord/shipping ord/billing
ord/shipmode ord/finalize affiliate/login ord/checkout login
change_password

## Set this if you have a different secure server
#AlwaysSecure   order ord/checkout ord/basket login change_password process

ifndef COMMON_ORDER_PROFILE
Variable COMMON_ORDER_PROFILE <<EOV
	fname=required
	lname=required
	address1=required
	city=required
	country=required
	state=multistate
	zip=multizip
	&or phone_night=phone, phone_day=phone Must have day or evening phone number
	email=required
EOV
endif

## Payment-related stuff

EncryptKey  __PGP_KEY__

## These routes are not order routes, but payment routes
Route  authorizenet  id           "__MV_PAYMENT_ID__"
Route  authorizenet  secret       "__MV_PAYMENT_SECRET__"
Route  authorizenet  host         "__MV_PAYMENT_HOST__"
Route  authorizenet  referer      "__MV_PAYMENT_REFERER__"

Route  cybercash     configfile   "__CYBER_CONFIGFILE__"

Route  itransact     id           "__MV_PAYMENT_ID__"

Route  signio        id           "__MV_PAYMENT_ID__"
Route  signio        secret       "__MV_PAYMENT_SECRET__"
Route  signio        partner      "__MV_PAYMENT_PARTNER__"
Route  signio        vendor       "__MV_PAYMENT_VENDOR__"
Route  signio        host         "__MV_PAYMENT_HOST__"

Route  skipjack      id           "__MV_PAYMENT_ID__"
Route  skipjack      partner      "__MV_PAYMENT_PARTNER__"


# This prevents a user from setting this value, you may want to unset
# this if you have user-selectable handling charges like insurance
FormIgnore   mv_handling
#
#

# Along these lines further, for better integrity and less chance of a
# user screwing up your order routes:
# Note that __ORDER_ROUTES__ is empty by default, default Route "default"
# is used with cascades
FormIgnore      mv_order_route

## This route places the order entry in the database. If you don't
## have an inventory table (or a userdb table for that matter) make
## sure you remove it from the list of "transactions" tables.

Route log  <<EOF
	empty        1
	encrypt      0
	increment    0
	report       etc/log_transaction
	supplant     0
	track        logs/log
EOF

## This route copies the user if they requested that. We don't
## care (much) if it fails, so error_ok is set and failure will
## not cause the order to fail
Route copy_user  <<EOF
	empty        1
	error_ok     1
	encrypt      0
	increment    0
	report       etc/mail_receipt
	supplant     0
	track        logs/log
EOF

ParseVariables Yes
## This route emails the order to you unless email is set to "",
## and failsafe-logs the order report a couple of places
Route main  <<EOF
	attach            0
	credit_card       1
	default           1
	email             '__ORDERS_TO__'
	encrypt           0
	errors_to         '__ORDERS_TO__'
	pgp_cc_key        "__PGP_KEY__"
	pgp_key           "__PGP_KEY__"
	receipt           etc/receipt.html
	report            etc/report
	supplant          1
	individual_track  orders
	track             logs/tracking.asc
EOF

## This route emails the order to you unless email is set to "",
## and failsafe-logs the order report a couple of places
Route main_entry  <<EOF
	attach            0
	credit_card       1
	email             '__ORDERS_TO__'
	encrypt           0
	errors_to         '__ORDERS_TO__'
	pgp_cc_key        "__PGP_KEY__"
	pgp_key           "__PGP_KEY__"
	report            etc/report
	supplant          1
	individual_track  orders
	track             logs/tracking.asc
EOF


# Order routes can be maintained in a database
# CHANGES TO THIS WILL OVERRIDE THE ROUTES ABOVE.
RouteDatabase   route

# Order desk route run if entered from admin
# always
Route   entry   master          1
Route   entry   cascade         "log main_entry copy_user"
Route   entry   empty           1
Route   entry   supplant        1
Route   entry   no_receipt      1
Route   entry   write_tables    "inventory userdb transactions orderline"
Route   entry   transactions    '__TRANSACTION_TABLES__'
Route   entry   email           '__ORDERS_TO__'

# Default route is run if no routes set, this should be last Route
# always
Route   default   master          1
Route   default   cascade         "log main copy_user"
Route   default   empty           1
Route   default   supplant        1
Route   default   write_tables    "inventory userdb transactions orderline"
Route   default   transactions    '__TRANSACTION_TABLES__'
Route   default   email           '__ORDERS_TO__'

## Uncomment this if you want Routes read dynamically from DB
#Route   default   dynamic_routes  1
## Uncomment this if you want ITL allowed in routes
#Route   default   expandable      1


SalesTax        __TAXFIELD__
TaxShipping     __TAXSHIPPING__
SeparateItems   Yes

OrderCounter    etc/order.number
OrderLineLimit  200
OrderProfile    etc/profiles.order etc/profiles.login etc/profiles.misc

UseModifier     size
UseModifier     color



#==========================================================================#

ifdef UI_TRAFFIC_STATS
TrackFile __UI_TRAFFIC_STATS__
endif

# Deal with customer click history. For example, after adding an item to
# the cart, the user can return to a specific search results page.
History 10

# Allow delivery of soft goods (downloadable files).
ActionMap  deliver   <<EOR
sub {
	my $deliverable = shift;
	$Scratch->{deliverable} = $CGI->{mv_arg};
	$CGI->{mv_nextpage} = 'deliver';
	if(! $Session->{username} and $CGI->{mv_username}) {
		$Tag->userdb('login');
	}
	return 1;
}
EOR

# Allow customers to have their passwords emailed to them.
ActionMap  get_password   <<EOR
sub {
	$Config->{NoSearch} = '';
	$CGI->{mv_nextpage} = $CGI->{mv_search_page} = 'action/get_password';
	$CGI->{mv_todo} = 'search';
	$Tag->update('process');
	return 1;
}
EOR

### WARNING -- if you have an etc/after.cfg file it may override these settings!
PriceField      0
CommonAdjust    :sale_price, ;:price, ;$, ==:options


## Only search products table by default, don't want returns from any variants
## or other subsidiary ProductsFile
Variable MV_DEFAULT_SEARCH_TABLE products
Variable MV_DEFAULT_SEARCH_FILE  products

## Set which tables can contain products for order
ProductFiles   products

### WARNING -- look below Some of the above definitions -- typically
### ProductFiles, Profile, CommonAdjust, OptionType, and other product-
### based definitions -- are re-set in the next included file.

#==========================================================================#

# Allow a template to drop in some ending config.
include etc/after.cfg

#==========================================================================#

ActionMap  category  <<EOR
sub {
       my ($action, $category) = split ('/', shift);
       $CGI->{mv_todo} ='search';
       $CGI->{mv_nextpage} = 'results';
       $CGI->{mv_search_file} = 'products';
       $CGI->{mv_searchtype} = 'db';
       $CGI->{mv_coordinate} = 'yes';
       $CGI->{mv_return_fields} =
'sku,prod_group,category,sub_category,
option_type,thumb,image,description,comment,tax_category,nontaxable,price';
       $CGI->{mv_matchlimit} = '25';
       $CGI->{mv_sort_field} = 'category';
       $CGI->{mv_sort_option} = 'f,n';
       $CGI->{mv_search_field} = 'category';
       $CGI->{mv_searchspec} = "$category";
       $CGI->{banner_text} = "$category";
       $Tag->update('process');
       return 1;
}
EOR

ActionMap  sub-category  <<EOR
sub {
       my ($action, $category, $sub_category) = split ('/', shift);
       $CGI->{mv_todo} ='search';
       $CGI->{mv_nextpage} = 'results';
       $CGI->{mv_search_file} = 'products';
       $CGI->{mv_searchtype} = 'db';
       $CGI->{mv_coordinate} = 'yes';
       $CGI->{mv_return_fields} =
'sku,prod_group,category,sub_category,
option_type,thumb,image,description,comment,tax_category,nontaxable,price';
       $CGI->{mv_matchlimit} = '25';
       $CGI->{mv_sort_field} = 'category';
       $CGI->{mv_sort_option} = 'f,n';
       $CGI->{mv_search_field} = 'category';
       $CGI->{mv_searchspec} = "$category";
       $CGI->{mv_search_field} = 'category';
       $CGI->{mv_searchspec} = "$category";
       $CGI->{banner_text} = "$sub_category";
       $Tag->update('process');
       return 1;
}
EOR


theme.cfg
============
# This file defines the variables for templating.

ParseVariables Yes

# Theme images directory
Variable  THEME             foundation
Variable  THEME_IMG_DIR     __THEME__/
Variable  THEME_LOGO     __THEME_IMG_DIR__/logo.gif

ifdef LOGO
Variable  THEME_LOGO  __LOGO__
endif

##
## Set a default CSS theme which can be overriden in Preferences
##

ifndef THEME_CSS
Variable THEME_CSS <<EOV

<STYLE TYPE="text/css">

BODY {
  background-color: #FFFFFF;
  font-family: Helvetica;
  font-size: 12px;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 0px;
  margin-bottom: 0px;
}

TD {
  font-family: Helvetica;
  font-size: 12px;
}

A:link, A:active, A:visited {
  color: #993333;
  font-family: Helvetica;
  font-weight: normal;
  text-decoration: underline;
  font-size: 12px;
}

A:hover {
  color: #FF3333;
  font-family: Helvetica;
  font-weight: normal;
  text-decoration: underline;
  font-size: 12px;
}

A.barlink:link, A.barlink:active, A.barlink:visited {
  color: #FFFFCC;
  font-family: Helvetica;
  font-weight: normal;
  text-decoration: none;
  font-size: 11px;
}

A.barlink:hover {
  color: #FFFFCC;
  font-family: Helvetica;
  font-weight: normal;
  text-decoration: underline;
  font-size: 11px;
}

.maincontent {
  background-color: #FFFFFF;
  color: #000000;
  font-family: Helvetica;
  font-weight: normal;
  font-size: 12px;
}

.contentbar1 {
  background-color: #DDDDDD;
  color: #000000;
  font-family: Helvetica;
  font-weight: normal;
  font-size: 11px;
}

.contentbar2 {
  background-color: #BBBBBB;
  color: #000000;
  font-family: Helvetica;
  font-weight: normal;
  font-size: 11px;
}

.categorybar {
  background-color: #993333;
  color: #FFFFFF;
  font-family: Helvetica;
  font-weight: normal;
  font-size: 11px;
}

.menubar {
  background-color: #CC3333;
  color: #FFFFFF;
  font-family: Helvetica;
  font-weight: normal;
  font-size: 11px;
}

</STYLE>
EOV
endif

##
## Here we pick up the region variables like LEFTONLY_TOP and LEFTONLY_BOTTOM.
##
DirConfig Variable templates/__THEME__/regions

##
## TRAFFIC is defined system-wide in interchange.cfg. When in
## low-traffic mode, variables are dynamic -- i.e. when you change the
## region file the page changes. Otherwise a reconfig must be done to
## change the variable.
##
ifdef @TRAFFIC =~ /low/i
Pragma dynamic_variables
Pragma dynamic_variables_file_only
endif


More information about the interchange-users mailing list