View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006089 | OXID ERP Interface | OXID ERP Interface - sub | public | 2015-03-17 11:07 | 2015-12-01 12:54 |
Reporter | michael_keiluweit | Assigned To | |||
Priority | low | Severity | text | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | 2.14.0 | ||||
Summary | 0006089: ERP CSV documentation is at least for create/update product wrong | ||||
Description | The documentation (4.2 Create/update products) says: 0: Indicator char 1: product id (OXID) 2: shop id 3: parent id 4: ... But since the shop id isn't used from the CSV file but from the login process, the field is useless and confuses while developing the CSV files for an import. My example CSV looks like this: V; 2.11.0 A; TESTOXIDART1; 2; 3; 4; 5; 6; 0000-00-00 00:00:00; 0000-00-00 00:00:00; TESTART1; OXEAN; OXDISTEAN; OXMPN; ERP VOODOO1 As you see, I set the number "2" for the shop id field, according the documentation. The important part of my import file: $sMessage = $oERP->doImport(getShopBasePath() . IMPORTPATH . IMPORTFILENAME , ADMINUSER, ADMINPASS, SHOPID, LANGID); The constant SHOPID has the value "1": define ('SHOPID', '1'); Database record after executing the import script: *************************** 1. row *************************** oxid: TESTOXIDART1 oxshopid: 1 oxshopincl: 3 oxshopexcl: 4 oxparentid: 5 oxactive: 6 oxactivefrom: 0000-00-00 00:00:00 oxactiveto: 0000-00-00 00:00:00 oxartnum: TESTART1 oxean: OXEAN oxdistean: OXDISTEAN oxmpn: OXMPN oxtitle: ERP VOODOO1 You see that the number "2" is missing and replaced by "1". | ||||
Steps To Reproduce | I edited the method oxERPType::_preAssignObject():if ($oCompat->isShopEE()) { if (!isset($aData['OXID']) || !$aData['OXID'] || !$oShopObject->exists( $aData['OXID'] )) { //$aData['OXSHOPID'] = $this->_iShopID; if (!$blAllowCustomShopId) { if (isset($aData['OXSHOPID'])) { $aData['OXSHOPID'] = oxConfig::getInstance()->getShopId(); [...] to if ($oCompat->isShopEE()) { if (!isset($aData['OXID']) || !$aData['OXID'] || !$oShopObject->exists( $aData['OXID'] )) { //$aData['OXSHOPID'] = $this->_iShopID; if (!$blAllowCustomShopId) { if (isset($aData['OXSHOPID'])) { echo '$aData[\'OXSHOPID\']: ' . $aData['OXSHOPID']; echo PHP_EOL; echo '$aData[\'OXSHOPID\'] overwritten by: ' . oxConfig::getInstance()->getShopId(); echo PHP_EOL; $aData['OXSHOPID'] = oxConfig::getInstance()->getShopId(); [...] While importing I got the following output: user /var/www/shops/ee_506 $ php import_articles.php requested wsdl version: 2.11.0 used db version: 10 import file: /var/www/shops/ee_506/import/ERP-CSV-Testdata-v.2110.csv $aData['OXSHOPID']: 2 $aData['OXSHOPID'] overwritten by: 1 user /var/www/shops/ee_506 $ | ||||
Additional Information | My proposal: Use the list of database fields in oxERPType_Article::$_aFieldListVersions to get an idea which field is used at which position. Please note that the field "OXID" isn't listed there but it is always at position 1 (after the indicator char). Also according to the bug entry from aboth, the shop id field isn't considered for creating or updating products. | ||||
Tags | Article, CSV, Documentation, EE, ERP | ||||