Magento News
1.2.1.2 catalog/product product->save() undefined index Type.php line 71
I have used nearly the same code for creating product for months now. All the sudden I get the following error:
PHP Fatal error: Uncaught exception 'Exception' with message 'Notice: Undefined index: in /var/www/rkworkwear/app/code/core/Mage/Catalog/Model/Product/Type.php on line 71' in /var/www/rkworkwear/app/code/core/Mage/Core/functions.php:246
Stack trace:
#0 /var/www/rkworkwear/app/code/core/Mage/Catalog/Model/Product/Type.php(71): mageCoreErrorHandler(8, 'Undefined index...', '/var/www/rkwork...', 71, Array)
#1 /var/www/rkworkwear/app/code/core/Mage/Catalog/Model/Product.php(134): Mage_Catalog_Model_Product_Type::factory(Object(Mage_Catalog_Model_Product))
#2 /var/www/rkworkwear/app/code/core/Mage/Catalog/Model/Product.php(303): Mage_Catalog_Model_Product->getTypeInstance()
#3 /var/www/rkworkwear/app/code/core/Mage/Core/Model/Abstract.php(249): Mage_Catalog_Model_Product->_beforeSave()
#4 /home/rkadmin/scripts/carhartt/init_items.php(10): Mage_Core_Model_Abstract->save()
#5 {main}
thrown in /var/www/rkworkwear/app/code/core/Mage/Core/functions.php on line 246
$product = Mage::getModel('catalog/product');
$product->setWebsiteIds(array('1'));
$product->setAttributeSetId(4);
$product->setSku($arg_data['sku']);
$product->setType('Simple Product');
$product->setName($arg_data['name']);
$product->setDescription('[description]');
$product->setShortDescription('[short_description]');
$product->setPrice($arg_data['price']);
$product->setWeight($arg_data['weight']);
$product->setStatus(1);
$product->setTaxClassId(2);
$product->setCategoryIds($arg_data['category_ids']);
$product->setVisibility(4);
$product->save();
I assume some functionality deep down in the core changed how a product is created? Any ideas where the undefined index is? I followed list of files the exception spit out and it deals with setting the product type, but I can’t get anywhere with this.
1.2.1.2 catalog/product product->save() undefined index Type.php line 71
Possibly Related Posts:
- 花粉ェ…
- Do you know how many of your customers are over the age of 18?? We can tell you http://t.co/RKNC85ti
- #Magento – Fix Product Reviews by jim222: I run a multi-site Magento store. A… http://t.co/todb1Fp4 #freelance #job
- Faille clients Magento : 3 semaines plus tard, silence radio de l’éditeur. #fail #comprendpas http://t.co/WRAMkzbr
- I received +K in magento from @EbullientErin, thanks! http://t.co/dfCN1tUc
RSS Feed