View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002013 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2010-07-30 20:20 | 2012-12-07 14:29 |
Reporter | andreas_ziethen | Assigned To | |||
Priority | high | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Product Version | 4.4.1 revision 28950 | ||||
Summary | 0002013: insert query for multishop fields is generated wrong (oxarticle::_createInsertStr()) | ||||
Description | I set up a mall with 7 shops. Structure is: 1 - main shop 2 - inherited from 1 3 - inherited from 1 4 - inherited from 2 5 - inherited from 2 6 - inherited from 3 7 - inherited from 3 Then I added the following fields to config.inc and oxfield2shop table: OXTITLE OXTITLE_1 OXTITLE_2 OXTITLE_3 OXTITLE_4 OXTITLE_5 OXTITLE_6 OXTITLE_7 OXTITLE_8 cause the oxtitle field should be editable individually for all languages in shop 4, 5, 6 and 7. But this did not work. So I debugged oxarticle::_createInsertStr() and printed out the generated insert string: insert into oxfield2shop ( oxid, oxshopid, oxartid , oxprice , oxpricea , oxpriceb , oxpricec , oxtitle_1 , oxtitle_2 , oxtitle_3 , oxtitle_4 , oxtitle_5 , oxtitle_6 , oxtitle_7 , oxtitle_8 , oxtitle , oxtitle_1 , oxtitle_2 , oxtitle_3 , oxtitle_4 , oxtitle_5 , oxtitle_6 , oxtitle_7 , oxtitle_8 ) select 'd7182b7a88a2db9a7a2e8d2a74029bed', '2', '1126' , '33' , '0' , '0' , '0' , oxarticles.oxtitle_1 , oxarticles.oxtitle_2 , oxarticles.oxtitle_3 , oxarticles.oxtitle_4 , oxarticles.oxtitle_5 , oxarticles.oxtitle_6 , oxarticles.oxtitle_7 , oxarticles.oxtitle_8 , 'Bar-Set ABSINTH global master' , '' , '' , '' , '' , '' , '' , '' , '' from oxarticles left join oxartextends on oxarticles.oxid=oxartextends.oxid where oxarticles.oxid="1126" As you can see, all the oxtitle fields are inserted twice - which causes an sql-error. If I deactivate this line: $sInsert1 .= ", $sOrigField "; (should be line 4761) then everything works fine. | ||||
Tags | Products | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
Further checks showed that my workaround did not work in all cases ... - so this is obviously not the proper solution. |
|
I just realized that this does happen only if you add fields to oxfield2shop which are multilingual fields. |
|
yes, you are right. If you add multilanguage field to config.inc.php, it adds automaticly all other fields. So, you have to add only OXTITLE to config.inc.php, other fields (OXTITLE_1, OXTITLE_2, OXTITLE_3, ...) will be added automaticly to insert string. But in database to oxfield2shop table must be added all multilanguage fields. |