98f954e330c488c884f0c0d32cac466fe74612aa angie Wed Mar 9 15:49:57 2011 -0800 While working on something else, I realized that when cartRemove iscalled on a list variable, it should remove the list's multShadow variable in addition to all values, because the list variable is no longer defined in the cart. If the multShadow is left around, it will look like the variable is in the cart, set to empty. diff --git src/hg/inc/cart.h src/hg/inc/cart.h index 1648b7b..ff97e39 100644 --- src/hg/inc/cart.h +++ src/hg/inc/cart.h @@ -23,33 +23,38 @@ /* function type used to cleanup a connection from database */ struct cart /* A cart of settings that persist. */ { struct cart *next; /* Next in list. */ unsigned int userId; /* User ID in database. */ unsigned int sessionId; /* Session ID in database. */ struct hash *hash; /* String valued hash. */ struct hash *exclude; /* Null valued hash of variables not to save. */ struct cartDb *userInfo; /* Info on user. */ struct cartDb *sessionInfo; /* Info on session. */ }; -char *_cartVarDbName(char *db, char *var); +INLINE char *_cartVarDbName(const char *db, const char *var) /* generate cart variable name that is local to an assembly database. * Only for use inside of cart.h. WARNING: static return */ +{ +static char buf[PATH_LEN]; // something rather big +safef(buf, sizeof(buf), "%s_%s", var, db); +return buf; +} boolean cartTablesOk(struct sqlConnection *conn); /* Return TRUE if cart tables are accessible (otherwise, the connection * doesn't do us any good). */ struct cart *cartNew(unsigned int userId, unsigned int sessionId, char **exclude, struct hash *oldVars); /* Load up cart from user & session id's. Exclude is a null-terminated list of * strings to not include. oldVars is an optional hash to put in values * that were just overwritten by cgi-variables. */ struct cart *cartOfNothing(); /* Create a new, empty, cart with no real connection to the database. */ struct cart *cartFromHash(struct hash *hash);