Uploaded image for project: 'PrestaShop 1.7'
  1. PrestaShop 1.7
  2. BOOM-5949

Combination Class has wrong definition reference filed.

    Details

    • Epic Link:
    • How to reproduce the issue ?:
      Try edit product combination reference when multistore is turn on.
    • Tests & Expected Results:
      N/A
    • Documentation Change:
      N/A

      Description

      CombinationClass has wrong definition of reference field.

      Is

      public static $definition = array(
      'table' => 'product_attribute',
      'primary' => 'id_product_attribute',
      'fields' => array(
      'id_product' => array('type' => self::TYPE_INT, 'shop' => 'both', 'validate' => 'isUnsignedId', 'required' => true),
      'location' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64),
      'ean13' => array('type' => self::TYPE_STRING, 'validate' => 'isEan13', 'size' => 13),
      'isbn' => array('type' => self::TYPE_STRING, 'validate' => 'isIsbn', 'size' => 32),
      'upc' => array('type' => self::TYPE_STRING, 'validate' => 'isUpc', 'size' => 12),
      'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'size' => 10),
      'reference' => array('type' => self::TYPE_STRING, 'size' => 32),
      'supplier_reference' => array('type' => self::TYPE_STRING, 'size' => 32),
      
      /* Shop fields */
      'wholesale_price' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice', 'size' => 27),
      'price' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isNegativePrice', 'size' => 20),
      'ecotax' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice', 'size' => 20),
      'weight' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isFloat'),
      'unit_price_impact' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isNegativePrice', 'size' => 20),
      'minimal_quantity' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedId', 'required' => true),
      'default_on' => array('type' => self::TYPE_BOOL, 'allow_null' => true, 'shop' => true, 'validate' => 'isBool'),
      'available_date' => array('type' => self::TYPE_DATE, 'shop' => true, 'validate' => 'isDateFormat'),
      ),
      );
      
      

      Should be

       

       

      public static $definition = array(
       'table' => 'product_attribute',
       'primary' => 'id_product_attribute',
       'fields' => array(
       'id_product' => array('type' => self::TYPE_INT, 'shop' => 'both', 'validate' => 'isUnsignedId', 'required' => true),
       'location' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64),
       'ean13' => array('type' => self::TYPE_STRING, 'validate' => 'isEan13', 'size' => 13),
       'isbn' => array('type' => self::TYPE_STRING, 'validate' => 'isIsbn', 'size' => 32),
       'upc' => array('type' => self::TYPE_STRING, 'validate' => 'isUpc', 'size' => 12),
       'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'size' => 10),
       'reference' => array('type' => self::TYPE_STRING, 'shop' => true, 'size' => 32),
       'supplier_reference' => array('type' => self::TYPE_STRING, 'size' => 32),
      /* Shop fields */
       'wholesale_price' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice', 'size' => 27),
       'price' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isNegativePrice', 'size' => 20),
       'ecotax' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice', 'size' => 20),
       'weight' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isFloat'),
       'unit_price_impact' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isNegativePrice', 'size' => 20),
       'minimal_quantity' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedId', 'required' => true),
       'default_on' => array('type' => self::TYPE_BOOL, 'allow_null' => true, 'shop' => true, 'validate' => 'isBool'),
       'available_date' => array('type' => self::TYPE_DATE, 'shop' => true, 'validate' => 'isDateFormat'),
       ),
       );
      

       

      Because of this when multistore is on and reference after edit it does not save in _product_attribute_shop

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              marcin_jaworski Marcin Jaworski
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: