I noticed this morning that my submitBasket[XSLT] was throwing an error, it might have been something I did yesterday but from the error message I cannot see where it would have come from as I havent done anything with the pipelines. Do you have an ideas?
System.Xml.Xsl.XslTransformException was unhandled by user code Message=An error occurred during a call to extension function 'Checkout'. See InnerException for a complete description of the error. Source=System.Data.SqlXml LineNumber=0 LinePosition=0 StackTrace: at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\Projects\uCommerceDemo\xslt\SubmitBasket[XSLT].xslt:line 22 at System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double ) at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements) InnerException: UCommerce.Pipelines.PipelineException Message=Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'. See inner exception for details. Source=UCommerce StackTrace: at UCommerce.Pipelines.Pipeline`1.Execute(T subject) at UCommerce.Transactions.CheckoutService.Checkout(Basket basket) at UCommerce.Xslt.TransactionLibrary.Checkout() at UCommerce.Xslt.Library.<Checkout>b__88() at UCommerce.Xslt.Library.HandledCall[T](Func`1 method) at UCommerce.Xslt.Library.Checkout() InnerException: System.InvalidOperationException Message=Sequence contains more than one element Source=NHibernate StackTrace: at NHibernate.Linq.NhQueryProvider.ExecuteQuery(NhLinqExpression nhLinqExpression, IQuery query, NhLinqExpression nhQuery) at NHibernate.Linq.NhQueryProvider.Execute[TResult](Expression expression) at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source, Expression`1 predicate) at UCommerce.EntitiesV2.Repository`1.SingleOrDefault(Expression`1 expression) at UCommerce.Pipelines.Checkout.CreateCustomerTask.Execute(PurchaseOrder purchaseOrder) at UCommerce.Pipelines.Pipeline`1.Execute(T subject) InnerException:
The issues is caused by the fact that there are more objects than assumed present in a collection. Basically there are a bunch of of "Single" or "SingleOrDefault" calls littered around the code. They assume that only one element and zero or one element are returned respectively. If there are more an exceptionn is thrown as you're seeing.
Are you running with the default pipeline tasks only or did you add some custom ones yourself? If they're the default I'd like to see your current dataset and see if uCommerce should handle the situation.
Thanks for the reply, we added one more custom pipeline in addition to this. As we dont want the system to go to a payment system and just need an email sent out once purchased.
I have tried that and tried changing the pipelines, but nothing seems to change, goes through the whole process but doesn't reset the checkout and doesnt add a completed order to the database like it did before.
It seems that my colleague can go through the whole process through my local server and it saves the order, but not on my machine. I might try and put this on another server and see if this has any effect on it. If not I'll send you the DB.
It might be your local basket that's screwed up somehow. You can try resetting the cookies for your test doman to get uCommerce to assign you a new one.
Error in Ucommerce
Hey,
I noticed this morning that my submitBasket[XSLT] was throwing an error, it might have been something I did yesterday but from the error message I cannot see where it would have come from as I havent done anything with the pipelines. Do you have an ideas?
Thanks
Jason
Hi Jason,
The issues is caused by the fact that there are more objects than assumed present in a collection. Basically there are a bunch of of "Single" or "SingleOrDefault" calls littered around the code. They assume that only one element and zero or one element are returned respectively. If there are more an exceptionn is thrown as you're seeing.
Are you running with the default pipeline tasks only or did you add some custom ones yourself? If they're the default I'd like to see your current dataset and see if uCommerce should handle the situation.
Hi Soren
Thanks for the reply, we added one more custom pipeline in addition to this. As we dont want the system to go to a payment system and just need an email sent out once purchased.
The additional pipeline looks like :
<component id="Checkout.SendConfirmationEmail"
service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
type="UCommerce.Pipelines.Common.SendEmailTask, UCommerce.Pipelines"
lifestyle="Thread">
Could this be a problem? It was working perfectly before hand.
Thanks
Jason
Try commenting that component out and see if you have better luck.
The component you posted is that the one you added? You should be able to add as many instances of it as you want as long as you keep the IDs unique.
Hi Soren,
I have tried that and tried changing the pipelines, but nothing seems to change, goes through the whole process but doesn't reset the checkout and doesnt add a completed order to the database like it did before.
Jason
Could you send me the database with repro steps via e-mail? I'll take a look. ssl AT ucommerce DOT dk.
Hi Soren,
It seems that my colleague can go through the whole process through my local server and it saves the order, but not on my machine. I might try and put this on another server and see if this has any effect on it. If not I'll send you the DB.
Jason
It might be your local basket that's screwed up somehow. You can try resetting the cookies for your test doman to get uCommerce to assign you a new one.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.