View Issue Details

IDProjectCategoryView StatusLast Update
0005166OXID eShop (all versions)4.07. Source code, Testpublic2013-06-14 14:42
Reportersettermjd 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionunable to reproduce 
Product Version 
Target VersionFixed in Version 
Summary0005166: Issue using oxUtilsObject::getInstance()->generateUId() in a foreach loop
DescriptionI have the following code, which I expect to continue to generate unique identifiers for use in the query. However, on the 5th iteration, the number returned is always the same as on the first iteration.

It results in the following MySQL error:

 - mysql error: [1062: Duplicate entry...

Is this a known bug? Alternatively, is there something that I'm doing wrong, which causes this error to occur?

foreach ($categories as $category) {
    $sql = sprintf($sQuery,
        $this->_db->quote(oxUtilsObject::getInstance()->generateUId()),
        $this->_db->quote($articleId),
        $this->_db->quote(trim($category))
    );
    $rs = $this->_db->Execute($sql);
}
Steps To ReproduceJust calling the code is enough to reproduce the error.
Additional InformationThe version of Oxid is: Enterprise Edition 5.0.3_54408
The operating system is Gentoo Linux.
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Version5.3
MySQL Version5.1

Activities

settermjd

2013-06-13 15:43

reporter   ~0008766

This is a non-issue. Please disregard.

jurate.baseviciene

2013-06-14 14:39

reporter   ~0008773

Reminder sent to: settermjd

Hi,
Could you post a sql query? Because we cannot reproduce this issue. Maybe do you use the same article ID ?
Best regards,