Fatal error when changed order status to confirm and have custom fields

Started by elkekas, March 27, 2015, 22:20:37 PM

Previous topic - Next topic

elkekas

Hi

I find this error when changed the status order in the backend and i have custom fields.

Fatal error: Cannot use object of type stdClass as array in /usr/home/amma-spain.org/web/administrator/components/com_virtuemart/models/customfields.php on line 108

Joomla 3.4.1 and Virtueemart 3.6.0.4

Help me...

elkekas

In the line 108..
   unset($productIds[$k]);

That is part of the function..

function getCustomEmbeddedProductCustomFields($productIds,$virtuemart_custom_id=0,$cartattribute=-1,$forcefront=FALSE){

      $app = JFactory::getApplication();
      $db= JFactory::getDBO ();
      $q = VirtueMartModelCustomfields::getProductCustomSelectFieldList();

      static $_customFieldByProductId = array();

      $hashCwAttribute = $cartattribute;
      if($hashCwAttribute==-1) $hashCwAttribute = 2;
      $productCustomsCached = array();
      foreach($productIds as $k=>$productId){
         $hkey = (int)$productId.$hashCwAttribute;
         if (array_key_exists ($hkey, $_customFieldByProductId)) {
            //$productCustomsCached = $_customFieldByProductId[$hkey];
            $productCustomsCached = array_merge($productCustomsCached,$_customFieldByProductId[$hkey]);
            unset($productIds[$k]);
         }
      }

elkekas

I have change the line for:

unset($productIds->$k);

and now there are the screen white....