JumpLink / magento-sailsjs-bugwelder3

0 stars 0 forks source link

fix crash with cache #2

Closed JumpLink closed 10 years ago

JumpLink commented 10 years ago
/var/www/magento-sailsjs-bugwelder3/node_modules/sails-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:242
        throw message;      
              ^
TypeError: Cannot read property 'required' of undefined
    at Object.makeProductCreateValid (/var/www/magento-sailsjs-bugwelder3/api/services/ProductAttributeService.js:97:19)
    at create (/var/www/magento-sailsjs-bugwelder3/api/services/ProductCacheService.js:88:27)
    at /var/www/magento-sailsjs-bugwelder3/api/services/ProductCacheService.js:141:7
    at /var/www/magento-sailsjs-bugwelder3/node_modules/sails/node_modules/waterline/lib/waterline/query/finders/basic.js:73:26
    at /var/www/magento-sailsjs-bugwelder3/node_modules/sails/node_modules/waterline/lib/waterline/adapter/dql.js:35:37
    at /var/www/magento-sailsjs-bugwelder3/node_modules/sails-mongo/lib/adapter.js:458:23
    at /var/www/magento-sailsjs-bugwelder3/node_modules/sails-mongo/lib/adapter.js:313:15
    at /var/www/magento-sailsjs-bugwelder3/node_modules/sails-mongo/node_modules/mongodb/lib/mongodb/cursor.js:162:16
    at commandHandler (/var/www/magento-sailsjs-bugwelder3/node_modules/sails-mongo/node_modules/mongodb/lib/mongodb/cursor.js:706:16)
    at /var/www/magento-sailsjs-bugwelder3/node_modules/sails-mongo/node_modules/mongodb/lib/mongodb/db.js:1806:9

I think this crash was after an product update in the magento admin site. The product was not found in the mongodb cache before.

JumpLink commented 10 years ago

Okay jetzt bin ich sicher, das passiert beim update eines produktes, welches noch nicht im cache existiert.

JumpLink commented 10 years ago
error: attribute code 'type' not found in 'ProductAttributes.json'

Das Attribute "type" wird bei den Attributen scheinbar nicht aufgezählt, allerdings besitzt jedes Produkt dieses Attribute, z.B.:

{ id: 16097,
  sku: '211-941-038/C',
  name: 'Scheinwerfer US-Version VW Bus -\'67 OE-Qualität rechts',
  set: 4,
  sku_type: null,
  type: 'simple',   <=== 
[...]
JumpLink commented 10 years ago

Standard Attribute "type" meiner API hinzugefügt