1. Chris Moffitt
  2. satchmo
  3. Issues
Issue #322 on hold

Error with many shipping modules

Anonymous created an issue

When you add many (the actual number depends on the length of the module names/paths) shipping modules there is an error caused by the data being saved to the database being truncated.

The exception raised is:

"Data truncated for column 'value' at row 1".

This subsequently causes an error during checkout.

Reported by Milton

Comments (6)

  1. Anonymous

    To reproduce you will need a number of shipping modules (sorry mine aren't ready to contribute yet). Make sure that the pathname is relatively long and then add a few of them, an example is below.

    Select the below shipping modules on the settings page, the actual modules selected aren't important, the length of the pathnames is what is causing the error.

    myshopping.shipping.modules.expresspost, myshopping.shipping.modules.standardpost, myshopping.shipping.modules.internationalairmail, myshopping.shipping.modules.internationalexpresscourier, myshopping.shipping.modules.internationalseamail, myshopping.shipping.modules.customerpickup, myshopping.shipping.modules.fallback

    My workaround was to shorten the pathnames down to myshopping.shipping.m.[shortened name] though it'd be nice to not have this issue.

    What appears to be happening is that the active modules list is being saved into a field that is too short to hold the length of the list hence errors are occurring.

    I should have mentioned I'm using mysql.

  2. Chris Moffitt repo owner
    • removed milestone

    I think we're going to need the longtext field here to solve the problem. We need to look and see if there are other places where this will be a problem. I'm moving out of 0.7 but do want to keep visibility to this.

  3. Hynek Cernoch

    No. It is related to livesettings group SHIPPING, value MODULES. It is MultipleStringValue, also sum of all length shipping.modules.something or my_prooojeeect.modules.sooomeeethiiing must be less then 255. Change to LongMultipleStringValue can be solution, but it would be backward incompatible. (If the old MultipleStringValue would be not removed from the database by the user or by special code, it could be eventually not possible to modify neither new nor old value. I am not sure I only suspect a problem.)

    I hope that the author fixed it easy by moving modules. Nobody complained repatedly. More serious are problems which led to issue https://bitbucket.org/bkroeze/django-livesettings/issue/24/heaps-of-fixes and if we do it good, classes MultipleStringValue and LongMultipleStringValue would be unified by backward compatible way.

    In other words: It is not good to do repeatedly more isolated similar backward incompatible changes.

  4. Log in to comment