Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Sep 2008
    Location
    Gold Coast, Australia
    Posts
    55
    Plugin Contributions
    0

    Default Passed variable is not an array or object ... when trying to add products

    I keep getting these warnings at the top of my zen cart admin page when I try to add more products to the store

    Warning: reset() [function.reset]: Passed variable is not an array or object in /mounted-storage/home101c/sub005/sc63153-FRAS/adultworld.net.au/store/admin/includes/classes/object_info.php on line 29

    Warning: Variable passed to each() is not an array or object in /mounted-storage/home101c/sub005/sc63153-FRAS/adultworld.net.au/store/admin/includes/classes/object_info.php on line 30

    I am not much of a programmer, so if this has happened to anyone else, please post the solution.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Passed variable is not an array or object ... when trying to add products

    Have you explored the posts in the Similar threads section at the bottom of this page?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Sep 2008
    Location
    Gold Coast, Australia
    Posts
    55
    Plugin Contributions
    0

    Default Re: Passed variable is not an array or object ... when trying to add products

    ok, I went to the links you mentioned but the one about the categories was solved without a real solution. I think that person just re-uploaded their whole site from an earlier date.

    My problem started when I reset the admin log. I got a warning to do so.

    I went to the admin/includes/classes/object_info.php and don't understand the problem.

    heres the code:

    class objectInfo {

    // class constructor
    function objectInfo($object_array) {
    //this line should be added, but should be tested first:
    // if (!is_array($object_array)) return;
    reset($object_array); <-----this is line 29
    while (list($key, $value) = each($object_array)) { <-----this is line 30
    $this->$key = zen_db_prepare_input($value);
    }
    }
    }
    ?>

    as I said before, I'm not much of a programer, I'm a graphic designer so this doesn't make much sense to me.

    When I try to add a new product my browser says " information from this form will be sent in a non secure way" and then gives the option to proceed or not.

    When I proceed I create a product with no image, even though I upload one through admin. No product description shows up either. Then the product shows up in the products page of the admin but its "off" by default. When turned "on" the product shows up in the store without an image, description or price (all were entered in the admin). When the product is clicked the user gets a "no product found" message.

    I still need to add another couple of hundred items to the store and this could prove to be a disaster

    If anyone can help, Thanks in advance.

  4. #4
    Join Date
    Sep 2008
    Location
    Gold Coast, Australia
    Posts
    55
    Plugin Contributions
    0

    Default Re: Passed variable is not an array or object ... when trying to add products

    I have just tried a test purchase and it didn't work. I keep getting the warning (as a customer) that "information from this form will be sent in a non secure way".

    Now customers cannot purchase products from my store either.

    I'm doomed !!

  5. #5
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Passed variable is not an array or object ... when trying to add products

    // if (!is_array($object_array)) return;


    Change to

    if (!is_array($object_array)) return;

    See if that works.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  6. #6
    Join Date
    Sep 2008
    Location
    Gold Coast, Australia
    Posts
    55
    Plugin Contributions
    0

    Default Re: Passed variable is not an array or object ... when trying to add products

    I tried this solution and it did not work. I keep getting:

    "This form will be sent in a way that is not secure. Are you sure you want to send it?"

    I checked out the admin/includes/configure.php and found this on lines 27 to 32:

    * If you desire your *entire* admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
    */
    define('HTTP_SERVER', 'http://myDomain.net.au');
    define('HTTPS_SERVER', 'https://myDomain.net.au');
    define('HTTP_CATALOG_SERVER', 'http://myDomain.net.au');
    define('HTTPS_CATALOG_SERVER', 'https://myDomain.net.au');

    Would I change it to?

    define('HTTP_SERVER', 'https://myDomain.net.au');
    define('HTTPS_SERVER', 'https://myDomain.net.au');
    define('HTTP_CATALOG_SERVER', 'https://myDomain.net.au');
    define('HTTPS_CATALOG_SERVER', 'https://myDomain.net.au');

  7. #7
    Join Date
    Sep 2008
    Location
    Gold Coast, Australia
    Posts
    55
    Plugin Contributions
    0

    Default Re: Passed variable is not an array or object ... when trying to add products

    This did not work either

  8. #8
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Passed variable is not an array or object ... when trying to add products

    What version of Zen Cart? Has it been upgraded ever? From what version(s)?
    What addons have you installed?
    How has your site been customized, compared to a brand new clean fresh install?
    How have you altered the database tables, if at all?
    Have you done any bulk loading using various addon/external tools? Which ones?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Sep 2008
    Location
    Gold Coast, Australia
    Posts
    55
    Plugin Contributions
    0

    Default Re: Passed variable is not an array or object ... when trying to add products

    The version is 1.3.8

    I have installed the "newsletter subscriber mod" and the "blank sidebox mod"(this was made by me, following a tutorial), and thats it.

    The "newsletter subsciber mod" did add an extra table to my database.

    As yet I have not been able to install "easy populate", or any other mass upload program. I've had extreme difficulty with this, it would make it easier to add the extra couple of hundred products I still have to add but can't now because of this problem.

    I am using the "theme 113" template from template monster. I have modified its css a fair bit, so it looks quite different to the original.

    Again, this problem started when I reset my admin log. I only did this because I got a warning to do so. Before this I backed up my database.

  10. #10
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Passed variable is not an array or object ... when trying to add products

    TM templates do NOT work with zencart. Period.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Warning: Variable passed to each() is not an array or object
    By caprimia in forum General Questions
    Replies: 2
    Last Post: 1 Feb 2013, 06:16 AM
  2. Replies: 4
    Last Post: 23 Jan 2010, 09:35 PM
  3. Variable passed to each() is not an array or object in
    By wareagletsf in forum Basic Configuration
    Replies: 2
    Last Post: 13 Mar 2008, 10:32 AM
  4. Passed variable is not an array or object in customers after upgrading
    By royalgemsnz in forum Upgrading from 1.3.x to 1.3.9
    Replies: 11
    Last Post: 21 Oct 2006, 03:09 AM
  5. Replies: 0
    Last Post: 8 Oct 2006, 11:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg