View Issue Details

IDProjectCategoryView StatusLast Update
0006324OXID eShop (all versions)4.07. Source code, Testpublic2016-02-05 18:05
Status acknowledgedResolutionopen 
Product Version4.9.3 / 5.2.3 
Target VersionFixed in Version 
Summary0006324: Inconsistence comment / method body
DescriptionIn oxbase.php a method "assign" exists. According to the method comment it returns null but when looking into the method body in no case null (afaik return; just exits the method) or true is returned.

According to the API it has not been fixed in EE v5.2.7.


     * Assigns DB field values to object fields. Returns true on success.
     * @param array $dbRecord Associative data values array
     * @return null
    public function assign($dbRecord)
        if (!is_array($dbRecord)) {

        if (!$this->canRead()) {
            return false;

        while (list($sName, $sValue) = each($dbRecord)) {

            // patch for IIS
            //TODO: test it on IIS do we still need it
            //if( is_array($value) && count( $value) == 1)
            // $value = current( $value);

            $this->_setFieldData($sName, $sValue);

        $sOxidField = $this->_getFieldLongName('oxid');
        $this->_sOXID = $this->$sOxidField->value;

        $sShopVarName = $this->_getFieldLongName('oxshopid');
        if (isset($this->$sShopVarName) && isset($this->$sShopVarName->value)) {

TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined



2016-02-05 16:14

reporter   ~0011451

EDIT: According to the method comment it returns null or true on success*


2016-02-05 16:42

administrator   ~0011453

Last edited: 2016-02-05 16:45

View 2 revisions

The code snippet in the description is not from a shop version 4.9.3. In a 4.9.3 the code looks like:
(It is the same on 4.9.7).
There is only a single return with no parameters. This will return null. (See
In other cases there is no return. This also will return null. (See
So nothing wrong until here.

But: As you correctly noted, the comment says "Returns true on success.". So this could be incorrect.


2016-02-05 18:05

reporter   ~0011454

@Code snippet:
> Weird it's not the same as I copy pasted it from a EE 5.2.3 instance.

@Return & null:
> I see, thanks for the link :)