Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • wolulcmit 357 posts 693 karma points
    Sep 30, 2011 @ 04:30
    wolulcmit
    0

    Weird issue if Shipping method Display Name is too long

    Hi there, I'm pretty sure I've found an interesting quirk/bug with the XSLT CommerceLibrary:EditShipmentInformation() Extension.

    Steps to replicate: (replicated on a fresh uCommerce 2.0.5.0 install with demostore 1.2.0.0 running umbraco 4.7.0.378)
    Set the displayName of one of your shipping methods to something really long.
    In my case it was "UK Royal Mail First class Recorded Delivery (£4.95)"

    (clear cookies before testing)
    add an item to your basket and proceed to checkout,
    Enter your address information, click proceed to shipping
    you should receive an XSLT error: Error parsing XSLT file: \xslt\UpdateAddressInformation[XSLT].xslt

    upon attaching to process from Visual studio to debug whats going on I got the following:

    {"An error occurred during a call to extension function 'EditShipmentInformation'. See InnerException for a complete description of the error."}

    Inner exception: {"String or binary data would be truncated.\r\nThe statement has been terminated."}

    [NHibernate.Exceptions.GenericADOException] {"could not insert: [UCommerce.EntitiesV2.Shipment][SQL: INSERT INTO uCommerce_Shipment (ShipmentName, CreatedOn, CreatedBy, ShipmentPrice, DeliveryNote, TrackAndTrace, Tax, TaxRate, ShipmentTotal, ShipmentDiscount, ShipmentAddressId, ShippingMethodId, OrderId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()]"}

    Stacktrace:

      at NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
       at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Object obj, ISessionImplementor session)
       at NHibernate.Action.EntityIdentityInsertAction.Execute()
       at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
       at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
       at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
       at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
       at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
       at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
       at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
       at NHibernate.Impl.SessionImpl.SaveOrUpdate(Object obj)
       at UCommerce.EntitiesV2.Repository`1.Save(T entity)
       at UCommerce.Xslt.TransactionLibrary.EditShipmentInformation(String addressName, String firstName, String lastName, String emailAddress, String phoneNumber, String mobilePhoneNumber, String company, String line1, String line2, String postalCode, String city, String state, String attention, Int32 countryId)
       at UCommerce.Xslt.Library.<>c__DisplayClassc4.<EditShipmentInformation>b__c3()
       at UCommerce.Xslt.Library.HandledCall[T](Func`1 method)

    I know you probably shouldnt name your shipping method display names that long (that's what description is for right?) but it would be nice if this would be listed as a know issue or scheduled for a fix

    thanks again
    - Tim

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 30, 2011 @ 10:13
    Søren Spelling Lund
    0

    Hi Tim,

    Good catch.

    uCommerce will copy the name of your shipping method to the shipment itself to make it easier to identify in the backend. Only the 'Name' column in the Shipment table maxes out at 50 chars. Your bumping into that limit. I'll make sure and do an update to remove that limitation.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 30, 2011 @ 10:19
    Søren Spelling Lund
    0

    BTW you can fix this yourself by changing the length of the name column in uCommerce_Shipment. Set it to 128 chars instead of the default 50.

  • wolulcmit 357 posts 693 karma points
    Sep 30, 2011 @ 11:31
    wolulcmit
    0

    thanks Søren, good to know you're on the case!

Please Sign in or register to post replies

Write your reply to:

Draft