View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007298 | OXID eShop (all versions) | 4.06. Language and translations | public | 2021-12-17 10:00 | 2021-12-17 17:08 |
Reporter | EsyonStephan | Assigned To | |||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | open | ||
Product Version | 6.3.0 | ||||
Summary | 0007298: Artikel Langbeschreibung wird mit der 1. geladenen Sprache überschrieben | ||||
Description | In der Logik eines unserer Module müssen wir einen Artikel in alles aktiven Sprachen laden, diverse Daten hinterlegen und diesen Artikel wieder speichern: $languages = Registry::getLang()->getLanguageIds(); $article = oxNew(Article::class); foreach (array_keys($languages) as $languageIds) { $article->loadInLang($languageIds, $articleId); $article->assign($data); $article->save(); } Hierdurch wird die Langeschreibung eines Artikel in der ersten geladen Sprache in alle nachfolgenden Sprachen gespeichert. Hintergrund ist, dass innerhalb der save() Funktion die getLongDescription() Funktion aufgerufen und der Wert für die Langbeschreibung in der Variable _LongDesc gespeichert wird. Beim laden und speichern des Artikels in der nächsten Sprache wird diese Variable nicht wieder zurück gesetzt. D.h._LongDesc ist != null und bleibt daher in der 1. geladenen Sprache erhalten. | ||||
Steps To Reproduce | Siehe Code in Beschreibung. | ||||
Additional Information | $languages = Registry::getLang()->getLanguageIds(); foreach (array_keys($languages) as $languageIds) { $article = oxNew(Article::class); $article->loadInLang($languageIds, $articleId); $article->assign($data); $article->save(); } Dennoch sollte diese "unschönheit" im OXID Core gefixt werden. | ||||
Tags | Article, Languages | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | 7.4 | ||||
Database Version | MySQL 5.6 | ||||
|
Hello Stephan, thanks for your report. First I want to tell you that all information in our Bugtracker needs to be in english since not everyone working with the software is german-speaking. Second thing I have to tell is that your reported issue is reproducable. You're right with your finding, but the main issue is whether connected to the save() function nor to the loadInLang() function: the behavior is reproducable simply by using the standard load() method and loading two products after another. The load() (or loadInLang()) method simply does not reset the long description value. Therefore I agree to the report it is an tweak to the framework, but since there is an old issue mentioning the main problem, I close this new report and set as duplicate of the old one. Furthermore I want to tell everyone coming up to this issue, that you simply need to initialize a new Article object right before loading the model from the database, like shown in the additional Informations by the reporter. [sp] |