Nov 22, 2009

OSCommerce Errors - Passed variable is not an array or object

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming

OSCommerce Errors - Passed variable is not an array or object

demolaynyc
I don't know where this topic is appropriate in so please move it if it's innapropriate for this place as this involves PHP and OSCommerce

Hi, I got an error stating the following:

Warning: reset(): Passed variable is not an array or object in /home/content/j/w/s/jws8118/html/catalog/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/content/j/w/s/jws8118/html/catalog/admin/includes/classes/object_info.php on line 18


Here's the source code:

CODE
<?php
/*
  $Id: object_info.php,v 1.6 2003/06/20 16:23:08 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  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);
      }
    }
  }
?>



More problems are that my client can't add products to his cart. He also cannot upload any new products to the categories.

I'm asking the PHP programmers who have experience with OS Commerce and also those who know this to please help me with this problem. My client needs this problem fixed as soon as possible. I need solutions ASAP. Thank you.

 

 

 


Comment/Reply (w/o sign-up)

Mark420
Hmm i dont use OScommerce ...I use Vurtua mart ...i found it much better and much better to hack it for your needs and a lot of support on thier forums..
Have you tried the Os forums?

Maybe try to backup the mysql db then remove Os commerce then reinstall with default values then replace the old db back in? that may work wink.gif

Comment/Reply (w/o sign-up)

ginginca
I have done a number of OSC sites myself, but my programming knowledge is weak.

Have you posted this on the OSC forum, or done a search for the error message on that forum.

Just as a side note ... I have started using Zen Cart for my E-Commerce projects. It is based on OSC, but to compare, it's like OSC on steroids.

Comment/Reply (w/o sign-up)

mastercomputers
This may not be the right way to go about it as I don't know what information is being passed to this class, but you could do:

CODE
class objectInfo {
    function objectInfo($object_array) {
        $object_array = is_array($object_array) ? $object_array : array($object_array);
        reset($object_array);
        while(list($key, $value) = each($object_array)) {
            $this->$key = tep_db_prepare_input($value);
        }
    }
}


That will just insure that $object_array is an array, so that these methods that expect arrays can still continue without any warnings, however, they're just warnings and can usually be ignored, you just have to make sure that your error_reporting doesn't display them.

Cheers,

MC

 

 

 


Comment/Reply (w/o sign-up)

demolaynyc
Thanks for the help. But we found out that it was because of the settings of the domain. The main domain's path had to be rerouted to the root folder.

Comment/Reply (w/o sign-up)

FeedBacker
Replying to demolaynyc
Hey! I have exactly the same problem... Can you please tell me more about this server setting and how to fix it up?
10x in advance!

-reply by Sergey

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Oscommerce Errors Passed Variable Array


    Looking for oscommerce, errors, passed, variable, array, object

See Also,

*SIMILAR VIDEOS*
Searching Video's for oscommerce, errors, passed, variable, array, object
advertisement



OSCommerce Errors - Passed variable is not an array or object

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com