These are chat archives for reactioncommerce/reaction
Hi Aaron, when I try to add an address on the checkout page with the current development version I get
Sanitized and reported to the client as: Shop must be a valid alphanumeric ID  I20150324-16:49:05.214(2)? I20150324-16:49:05.224(2)? Exception while invoking method 'addressBookAdd' Error: Shop must be a valid alphanumeric ID
Did anyone else have this issue?
@boboci9 nope I am not seeing that.
however, I'm trying to track an elusive error occurring sporadically on checkout - where iron-router seems to die the first time you hit checkout..
Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?
Could be related, if you see this message before you try to add address, it could be that Shops is not subscribed.
Exception while invoking method 'inviteShopMember' ReferenceError: setMailUrlForShop is not defined
although I don’t see that particular error. I see:
Exception while invoking method 'inviteShopMember' TypeError: Cannot read property 'name' of undefined I20150324-11:48:27.341(-7)? at [object Object].Meteor.methods.inviteShopMember (packages/reactioncommerce:core/server/methods/accounts/accounts.coffee:93:48)
which looks like it’s just a problem reading shop settings
Meteor.publish 'accounts', (sessionId, userId) -> check sessionId, Match.OneOf(String, null) check userId, Match.OneOf(String, null) shopId = ReactionCore.getShopId(@) # admin gets it all if Roles.userIsInRole(this.userId, ['admin','owner']) return Accounts.find shopId: shopId # returns userId (authenticated account) else ReactionCore.Events.debug "subscribe account", sessionId, this.userId # get current account if @userId # userAccount accountId = ReactionCore.Collections.Accounts.findOne('userId': this.userId)?._id else # sessionAccount accountId = ReactionCore.Collections.Accounts.findOne('sessions': sessionId)?._id unless accountId accountId = ReactionCore.Collections.Accounts.insert 'sessions': [sessionId], 'userId': userId #return accountId ReactionCore.Events.info "publishing account", accountId return ReactionCore.Collections.Accounts.find accountId
@aaronjudd I fixed that initial issue you had by updating line 99 to check for a profile before looking for name:
currentUserName = Meteor.user().profile?.name || Meteor.user().username || "Admin"
edit: also thanks for fixing.
Not sure why this is but my error comes from here:
_.extend ReactionCore, shopIdAutoValue: -> return if @isSet and @isFromTrustedCode if Meteor.isClient and @isInsert # will be set correctly on the server return ReactionCore.getShopId() or "1" else if Meteor.isServer and (@isInsert or @isUpsert) # forced value for client-initiated inserts # or for server-initiated inserts where shopId isn't set return ReactionCore.getShopId() else # for client-initiated update, be # sure we don't allow changing this property @unset() return
I debugged it and it always enters the second else that's why I get the 'Shop must be a valid alphanumeric ID' error. Do you know what could be the issue here? It's possible that one of my packages is the problem but still not sure what I'm looking for
@boboci9 I’m not able to reproduce this, but
ReactionCore.Schemas.Address = new SimpleSchema _id: type: String defaultValue: Random.id() optional: true fullName:
do you have some code that is updating the address, is it setting _id (or not)?
the arguments changed for addressBookAdd
addressBookAdd: (doc, accountId) -> @unblock() check doc, ReactionCore.Schemas.Address
shopId: type: String autoValue: ReactionCore.shopIdAutoValue regEx: SimpleSchema.RegEx.Id