View Issue Details

IDProjectCategoryView StatusLast Update
0002013OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2012-12-07 14:29
Reporterandreas_ziethen Assigned To 
PriorityhighSeveritycrashReproducibilityalways
Status resolvedResolutionno change required 
Product Version4.4.1 revision 28950 
Summary0002013: insert query for multishop fields is generated wrong (oxarticle::_createInsertStr())
DescriptionI 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.
TagsProducts
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

andreas_ziethen

2010-08-08 11:09

reporter   ~0003364

Further checks showed that my workaround did not work in all cases ... - so this is obviously not the proper solution.

andreas_ziethen

2010-08-08 14:36

reporter   ~0003365

I just realized that this does happen only if you add fields to oxfield2shop which are multilingual fields.

vilma_liorensaityte

2010-08-09 13:28

reporter   ~0003366

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.