View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002731 | OXID eShop (all versions) | 4.06. Language and translations | public | 2011-04-08 14:21 | 2011-04-29 16:24 |
Reporter | Helmut L. | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.0_beta4 | ||||
Target Version | Fixed in Version | 4.5.0 revision 34568 | |||
Summary | 0002731: long description for articles in additional languages isalways saved in main table | ||||
Description | If you have an article with a long description and copy it to a language not in the main table, it is still tried to insert it into the main table. Here the entries in all language tables of oxartextends should be created first, like it is done in oxarticles. Afterwards the oxlongdesc field in the correct table should be updated. | ||||
Additional Information | Enterprise Edition /core/oxarticle.php, line 3049 - 3052 Added is a patch file for /svnee/branches/features/EE/eshop/core/oxarticle.php, revision 1852 | ||||
Tags | No tags attached. | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
patch.txt (1,493 bytes)
### Eclipse Workspace Patch 1.0 #P nailart Index: core/oxarticle.php =================================================================== --- core/oxarticle.php (revision 1852) +++ core/oxarticle.php (working copy) @@ -3046,10 +3046,17 @@ $blSave = $blSave && !$this->isDerived() && $this->canUpdateField( "oxlongdesc" ); if ( $blSave ) { + foreach (oxNew('oxDbMetaDataHandler')->getAllMultiTables('oxartextends') as $sTable) { + $sLongDescSQL = 'insert ignore into ' . $sTable . ' (' . $sTable . ".oxid) + values ('".$this->getId()."')"; + oxDb::getDb()->execute( $sLongDescSQL ); + } + + $sLangTable = getLangTableName('oxartextends', $this->getLanguage()); $sLangField = oxLang::getInstance()->getLanguageTag( (int) $this->getLanguage() ); - $sLongDescSQL = "insert into oxartextends (oxartextends.oxid, oxartextends.oxlongdesc{$sLangField}) - values ('".$this->getId()."', ?) on duplicate key update oxartextends.oxlongdesc{$sLangField} = ? "; - oxDb::getDb()->execute( $sLongDescSQL, array( $sValue, $sValue ) ); + $sLongDescSQL = "update " . $sLangTable . " set " . $sLangTable . ".oxlongdesc{$sLangField} = ? + where " . $sLangTable . ".oxid = '".$this->getId()."'"; + oxDb::getDb()->execute( $sLongDescSQL, array( $sValue ) ); } } |
|
patch_main_table.txt (1,568 bytes)
### Eclipse Workspace Patch 1.0 #P EE 4.5 Index: core/oxarticle.php =================================================================== --- core/oxarticle.php (revision 1852) +++ core/oxarticle.php (working copy) @@ -3046,10 +3046,19 @@ $blSave = $blSave && !$this->isDerived() && $this->canUpdateField( "oxlongdesc" ); if ( $blSave ) { + $aTables = oxNew('oxDbMetaDataHandler')->getAllMultiTables('oxartextends'); + $aTables[] = 'oxartextends'; + foreach ($aTables as $sTable) { + $sLongDescSQL = 'insert ignore into ' . $sTable . ' (' . $sTable . ".oxid) + values ('".$this->getId()."')"; + oxDb::getDb()->execute( $sLongDescSQL ); + } + + $sLangTable = getLangTableName('oxartextends', $this->getLanguage()); $sLangField = oxLang::getInstance()->getLanguageTag( (int) $this->getLanguage() ); - $sLongDescSQL = "insert into oxartextends (oxartextends.oxid, oxartextends.oxlongdesc{$sLangField}) - values ('".$this->getId()."', ?) on duplicate key update oxartextends.oxlongdesc{$sLangField} = ? "; - oxDb::getDb()->execute( $sLongDescSQL, array( $sValue, $sValue ) ); + $sLongDescSQL = "update " . $sLangTable . " set " . $sLangTable . ".oxlongdesc{$sLangField} = ? + where " . $sLangTable . ".oxid = '".$this->getId()."'"; + oxDb::getDb()->execute( $sLongDescSQL, array( $sValue ) ); } } |
|
Just realized my solution was not adding an entry in the main table. Here is the corrected patch file. |
|
this problem was fixed for final 4.5.0 version |