View Issue Details

IDProjectCategoryView StatusLast Update
0006087OXID ERP InterfaceOXID ERP Interface - subpublic2024-01-23 16:39
Reportermichael_keiluweit Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version2.14.0 
Summary0006087: Missing table prefix in a SQL query can cause an error
DescriptionBy using the ERP SOAP method OXERPGetArticle it calls oxERPType_Article::_getSqlFieldName() which returns the fixed fieldname "OXREMINDACTIVE", but without the prefix "a" (modules/erp/objects/oxerptype_article.php:1272) as seen in oxERPType_Article::_getSqlFieldName() (modules/erp/objects/oxerptype_article.php:1318).
This isn't a problem until the column "OXFIELDREMINDACTIVE" is added to the table oxfield2shop. When it was added then the built SQL query from aboth fails with an error:

object(stdClass)#4 (1) {
  ["OXERPGetArticleResult"]=>
  object(stdClass)#5 (2) {
    ["blResult"]=>
    bool(false)
    ["sMessage"]=>
    string(2848) "mysql error: [1052: Column 'OXREMINDACTIVE' in field list is ambiguous] in EXECUTE("select `a`.OXID, `a`.OXSHOPID, `a`.OXSHOPINCL, `a`.OXSHOPEXCL, `a`.OXPARENTID, `a`.OXACTIVE, `a`.OXACTIVEFROM, `a`.OXACTIVETO, `a`.OXARTNUM, `a`.OXEAN, `a`.OXDISTEAN, `a`.OXMPN, `a`.OXTITLE, `a`.OXSHORTDESC,  IFNULL(`f2s`.`OXPRICE`, `a`.`OXPRICE`) as `OXPRICE`, `a`.OXBLFIXEDPRICE,  IFNULL(`f2s`.`OXPRICEA`, `a`.`OXPRICEA`) as `OXPRICEA`,  IFNULL(`f2s`.`OXPRICEB`, `a`.`OXPRICEB`) as `OXPRICEB`,  IFNULL(`f2s`.`OXPRICEC`, `a`.`OXPRICEC`) as `OXPRICEC`, `a`.OXBPRICE, `a`.OXTPRICE, `a`.OXUNITNAME, `a`.OXUNITQUANTITY, `a`.OXEXTURL, `a`.OXURLDESC, `a`.OXURLIMG, `a`.OXVAT, `a`.OXTHUMB, `a`.OXICON,  IFNULL(`f2s`.`OXPICSGENERATED`, `a`.`OXPICSGENERATED`) as `OXPICSGENERATED`, `a`.OXPIC1, `a`.OXPIC2, `a`.OXPIC3, `a`.OXPIC4, `a`.OXPIC5, `a`.OXPIC6, `a`.OXPIC7, `a`.OXPIC8, `a`.OXPIC9, `a`.OXPIC10, `a`.OXPIC11, `a`.OXPIC12, `a`.OXWEIGHT, `a`.OXSTOCK, `a`.OXSTOCKFLAG, `a`.OXSTOCKTEXT, `a`.OXNOSTOCKTEXT, `a`.OXDELIVERY, `a`.OXINSERT, `a`.OXTIMESTAMP, `a`.OXLENGTH, `a`.OXWIDTH, `a`.OXHEIGHT, `a`.OXFILE, `a`.OXSEARCHKEYS, `a`.OXTEMPLATE, `a`.OXQUESTIONEMAIL, `a`.OXISSEARCH, `a`.OXISCONFIGURABLE, `a`.OXVARNAME, `a`.OXVARSTOCK, `a`.OXVARCOUNT, `a`.OXVARSELECT, `a`.OXVARMINPRICE, `a`.OXVARMAXPRICE, `a`.OXVARNAME_1, `a`.OXVARSELECT_1, `a`.OXVARNAME_2, `a`.OXVARSELECT_2, `a`.OXVARNAME_3, `a`.OXVARSELECT_3, `a`.OXTITLE_1, `a`.OXSHORTDESC_1, `a`.OXURLDESC_1, `a`.OXSEARCHKEYS_1, `a`.OXTITLE_2, `a`.OXSHORTDESC_2, `a`.OXURLDESC_2, `a`.OXSEARCHKEYS_2, `a`.OXTITLE_3, `a`.OXSHORTDESC_3, `a`.OXURLDESC_3, `a`.OXSEARCHKEYS_3, `a`.OXFOLDER, `a`.OXSUBCLASS, `a`.OXSTOCKTEXT_1, `a`.OXSTOCKTEXT_2, `a`.OXSTOCKTEXT_3, `a`.OXNOSTOCKTEXT_1, `a`.OXNOSTOCKTEXT_2, `a`.OXNOSTOCKTEXT_3, `a`.OXSORT, `a`.OXSOLDAMOUNT, `a`.OXNONMATERIAL, `a`.OXFREESHIPPING, OXREMINDACTIVE as OXREMINDACTIV, `a`.OXREMINDAMOUNT, `a`.OXAMITEMID, `a`.OXAMTASKID, `a`.OXVENDORID, `a`.OXMANUFACTURERID, `a`.OXSKIPDISCOUNTS, `a`.OXORDERINFO, `a`.OXPIXIEXPORT, `a`.OXPIXIEXPORTED, `a`.OXVPE, `a`.OXRATING, `a`.OXRATINGCNT, `a`.OXMINDELTIME, `a`.OXMAXDELTIME, `a`.OXDELTIMEUNIT, `ax`.OXLONGDESC, `ax`.OXLONGDESC_1, `ax`.OXLONGDESC_2, `ax`.OXLONGDESC_3,  IFNULL(`f2s`.`OXUPDATEPRICE`, `a`.`OXUPDATEPRICE`) as `OXUPDATEPRICE`,  IFNULL(`f2s`.`OXUPDATEPRICEA`, `a`.`OXUPDATEPRICEA`) as `OXUPDATEPRICEA`,  IFNULL(`f2s`.`OXUPDATEPRICEB`, `a`.`OXUPDATEPRICEB`) as `OXUPDATEPRICEB`,  IFNULL(`f2s`.`OXUPDATEPRICEC`, `a`.`OXUPDATEPRICEC`) as `OXUPDATEPRICEC`,  IFNULL(`f2s`.`OXUPDATEPRICETIME`, `a`.`OXUPDATEPRICETIME`) as `OXUPDATEPRICETIME`, `a`.OXISDOWNLOADABLE from oxv_oxarticles_1 AS `a`  LEFT JOIN oxfield2shop AS `f2s` ON `f2s`.`oxartid` = `a`.`oxid` AND `f2s`.`oxshopid` = '1' LEFT JOIN oxartextends AS `ax` ON `ax`.`oxid` = `a`.`oxid` where `a`.`oxid` = 'foobar' order by `a`.`oxid`")
"
  }
}
TagsArticle, EE, ERP, SQL

Activities

There are no notes attached to this issue.