News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Warning: Creating default object from empty value in...

Started by sagepos, September 10, 2012, 04:25:00 AM

Previous topic - Next topic

sagepos

When I click "SHOP", I get the following message:

Warning: Creating default object from empty value in C:\xampp\htdocs\administrator\components\com_virtuemart\helpers\shopfunctions.php on line 278

The code below contains line 278:
   $countries_list=array();
      $i=0;
       foreach ($sorted_countries as  $key=>$value) {
           $countries_list[$i]->$id = $key;                  ///Line 278
         $countries_list[$i]->$name = $value;
          $i++;

The error message fills the whole page when I click the SHOP button.
When I rem the above code, the Shop will open just fine.  However, I can't make changes and save them because it requires country/state information which doesn't load because the above code is remmed.
When I unrem the code, it goes back to giving me the line 278 messages...

Any idea what my problem is?

Thanks,
Bryan Moore

vaistik

I've run in the same issue, clean install.

I know it's just a warning and I could hide it but I want it to be clean.

I guess it appears because it treats an array as an object. Any ideas on how to resolve this?

Cheers!

jenkinhill

#2
What version of PHP are you using?

@sagepos you can just suppress the warning to be able to continue to develop the site. The function still works.  http://forum.virtuemart.net/index.php?topic=102555.0
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

vaistik

#3
Hi and thanks for the reply.

I'm using 5.4.6

Edit: Tried it on 5.3.16 and works fine.

jenkinhill

Joomla 2.5 has problems with PHP5.4+ and VM2 has not yet been optimised for it - too many people are using PHP5.2 even now.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

fiore

I'm using Joomla version 2.57 and php version 5.4.4
That's ok!!

But I found the problem with VirtueMart 2.0.10 in line 278 as above mail. >.<

MLucian

I had the same problem as sagepos. PHP Version 5.4.4, MySQL 5.5, Apache 2.4.2. Just go to joomla golbal configuration page, server tab and set error reporting to none.

fiore