View Issue Details

IDProjectCategoryView StatusLast Update
0007298OXID eShop (all versions)4.06. Language and translationspublic2021-12-17 17:08
ReporterEsyonStephan Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionopen 
Product Version6.3.0 
Summary0007298: Artikel Langbeschreibung wird mit der 1. geladenen Sprache überschrieben
DescriptionIn 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 ReproduceSiehe 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.
TagsArticle, Languages
ThemeNot defined
BrowserNot defined
PHP Version7.4
Database VersionMySQL 5.6

Relationships

duplicate of 0006287 resolvedSvenBrunk oxarticle::load doesn't reset long description 

Activities

QA

2021-12-17 17:03

administrator   ~0013520

Last edited: 2021-12-17 17:08

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]