Sort Attributes Problem

Hi,

i have currently a Problem with sorting the Variants, we call it as eg. 35, 36,37 or S, M and L for a Textile Shop.

So now, made a Module to use own getVariants, but im confused, if i put this in template after i get Crossselling, it will result in a error:


Fatal error: Cannot assign by reference to overloaded object in /var/www/core/oxarticle.php on line 1247

Part of the Module is:

…sql and result…
        if (!$oVariants->count()) {
            return array();
         }
         $this->_aVariants = $oVariants;
         return $oVariants;
    }

If i remove in core/oxarticle.php

            // cache
            $sCacheKey = $blSimple ? "simple" : "full";
            if ( $blRemoveNotOrderables ) {
                if ( isset( $this->_aVariants[$sCacheKey] ) ) {
                   return $this->_aVariants[$sCacheKey];
                } else {
                    $this->_aVariants[$sCacheKey] = & $oVariants;
                }
            } elseif ( !$blRemoveNotOrderables ) {
                if ( isset( $this->_aVariantsWithNotOrderables[$sCacheKey] ) ) {
                    return $this->_aVariantsWithNotOrderables[$sCacheKey];
                } else {
                    $this->_aVariantsWithNotOrderables[$sCacheKey] = & $oVariants;
                }
            }

it works.

But im blind, i dont see the error at this Moment… Maybe anyone can help me out.