Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Variable passed to reset error


JohnSmithson

Recommended Posts

Posted

Hello everyone,

OsCommerce has seemed to always work well, but today when I tried to edit a product it totally blanked all the information as well as the image for that product. In the admin Categories / Products all I have is a blank line where that product use to be but no info. If I click it it has no info and no image but says when it added, thats it. When I try to edit or add any new product I get this error:

 

Warning: Variable passed to reset() is not an array or object in /home/includes/classes/object_info.php on line 17

 

Warning: Variable passed to reset() is not an array or object in /home/includes/classes/object_info.php on line 18

 

I am so confused.java script:emoticon(":'(",

smilie

 

Thanks,

John

Posted

admin/includes/classes/object_info.php - lines 17 and 18:

	}
 }
?>

So, first off, check that you dont have a closing ?> tag before these. Also, I am a little concerned that you said the error was in home/includes/classes/object_info.php when you should be in your admin folder....?

Posted

Thank you for your reply,

 

This is my code from line 13 to 16

 

You are right it was in the admin folder my mistake

 

class objectInfo {

 

// class constructor

function objectInfo($object_array) {

reset($object_array);

while (list($key, $value) = each($object_array)) {

$this->$key = tep_db_prepare_input($value);

}

}

}

?>

Posted

OK,

 

I can edit the products using phpAdmin directly and it works. If I use oscommerce to edit the same product it erases it again.

 

I am so stumped.

Posted

For those who might be interested,

 

 

My ISP reinstalled PHP on our server.

 

By default I was told that php shorthand is turned off, and apparantly OsCommerce is written in shorthand.

 

Everything is all and well now.

 

Thanks again

 

John

Posted
and apparantly OsCommerce is written in shorthand.

I don't think so. You can download the default zip archive and check them. They use the long form. Perhaps some contributions or other scripts you installed caused the problem.

  • 2 weeks later...
Posted

I was having the same error as JohnSmithson, could not add a new item or upload a picture, I looked around for quite some time, tried different solutions but nothing worked. Until, that is, I tried adding an item with a browser other than Firefox! It works fine in Mozilla and in Konqueror (under linux) but I still cannot get it to work properly in Firefox, even after clearing out the cache. If you are having this same problem, try a different browser.

It doesn't make sense to me, Firefox has always worked fine before, but I thought I'd pass it on, maybe it'll save somebody a terrible amount of hours!

:wacko:

Es que se me chispotio! Eso, Eso, Eso!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...