Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> OSCommerce Errors, Passed variable is not an array or object
demolaynyc
post Jan 1 2007, 03:45 AM
Post #1


Premium Member
Group Icon

Group: Members
Posts: 330
Joined: 2-February 06
Member No.: 11,040



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.
Go to the top of the page
 
+Quote Post
Mark420
post Jan 1 2007, 12:52 PM
Post #2


The Modernator
Group Icon

Group: Members
Posts: 486
Joined: 6-August 06
From: The Interweb!
Member No.: 15,021



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
Go to the top of the page
 
+Quote Post
ginginca
post Jan 3 2007, 01:15 PM
Post #3


Premium Member
Group Icon

Group: Members
Posts: 250
Joined: 6-July 06
From: The net (or at least that's what my family says)
Member No.: 14,330



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.
Go to the top of the page
 
+Quote Post
mastercomputers
post Jan 8 2007, 04:00 AM
Post #4


PESTICIDAL MANIAC
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



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
Go to the top of the page
 
+Quote Post
demolaynyc
post Jan 9 2007, 04:52 PM
Post #5


Premium Member
Group Icon

Group: Members
Posts: 330
Joined: 2-February 06
Member No.: 11,040



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.
Go to the top of the page
 
+Quote Post
iGuest
post Jun 2 2008, 08:22 AM
Post #6


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Permanent Variable(7)
  2. Changing Path Of Shared Object(2)
  3. New Tutorials Have Issues(2)
  4. Simple Java Question(3)
  5. Array Sorting(21)
  6. Phpmyadmin Continues To Have Errors.(17)
  7. Errors When Installing/booting(13)
  8. Delphi - Tfilestream(1)
  9. Enumeration Enum = .....(4)
  10. How To Reset The Server Variable Php_auth_user(9)
  11. C# Tutorial : Lesson 4 - Object Oriented Programming(2)
  12. Strange Errors With Servers?(6)
  13. Force Object To Load Last(2)
  14. Cute News Errors!(0)
  15. Can Anyone Help Me Detecting 503 Errors In Php Progs ?(5)
  1. Hi, Looking To Host Oscommerce Site(0)
  2. How To Repair Disk Errors And Bad Sectors(2)
  3. Cleanly Killing The Itunes Com Object(2)
  4. Y = New Array()(2)
  5. Working Out A Date Has Passed(6)
  6. VB6 Need Help With Object Validation(4)
  7. Send Php Variable To Javascript(5)
  8. Unexpected Error(2)
  9. Problem In Theme Or Active Object!(4)
  10. Php Any Variable In String.(1)
  11. Oscommerce(1)
  12. Php Mysql Errors(2)
  13. Ruby - Better Programming Language Than Java Or C#?(1)
  14. Installing Ipb Help(5)
  15. Php - Object Oriented Programming(1)


 



- Lo-Fi Version Time is now: 13th October 2008 - 03:51 PM