Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    61
    Plugin Contributions
    1

    Default Added customer field, getting Argument #1 is not an array in admin

    Hello and thank you for your time. I needed to add some customer details fields to my site and I did so following the guidance from this link:

    http://www.zen-cart.com/forum/showth...r+field&page=2

    Everything works good, I added Address line 3 and urbanization code. I can make changes in My Account, in admin I can do updates, etc, everythings splendid. But in admin on the Customers >> Customers page, I have 4 errors, that only show up when a customer is not selected, for example when first navigating to the page.

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/hume2/public_html/admin/customers.php on line 1136

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/hume2/public_html/admin/customers.php on line 1138

    Warning: reset() [function.reset]: Passed variable is not an array or object in /home/hume2/public_html/admin/includes/classes/object_info.php on line 29

    Warning: Variable passed to each() is not an array or object in /home/hume2/public_html/admin/includes/classes/object_info.php on line 30
    The first two errors, refer to untouched core code on customers.php:
    Code:
    $customer_info = array_merge($country->fields, $info->fields, $reviews->fields);
    $cInfo_array = array_merge($customers->fields, $customer_info);
    Anyone with ideas I'm listening. Everything works fine just those errors.... Also, I've recently upgraded it to Zen 1.3.8a, PHP 5.2.6, and MySql 5.0.58 but funny enough all that went off without a hitch. haha! and thanks!

  2. #2
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    61
    Plugin Contributions
    1

    Default Re: Added customer field, getting Argument #1 is not an array in admin

    I just did this...
    Code:
            $customer_info = array_merge(array($country->fields), array($info->fields), $reviews->fields);
    I migrated some customers in and had some NULLs in the customers_info_date_account_last_modified and customers_info_date_of_last_logon fields. If those values were coming back NULL in the script, an actual array couldn't be created for use in array_merge. Here, I'm just typecasting whatever variable is being used ($country->fields) into an array, if it isn't already one. So if a NULL gets passed in, It becomes an array of 1 element, with value of NULL. In PHP5, array_merge accepts only arrays.

 

 

Similar Threads

  1. Warning: array_merge() [function.array-merge]: Argument #1 is not an array
    By antieuclid in forum PayPal Express Checkout support
    Replies: 3
    Last Post: 19 Jul 2010, 02:50 AM
  2. Replies: 19
    Last Post: 14 Dec 2009, 01:17 PM
  3. Replies: 1
    Last Post: 14 Mar 2008, 02:58 AM
  4. Error: Argument #1 is not an array in
    By Fuzion in forum Managing Customers and Orders
    Replies: 2
    Last Post: 2 Feb 2008, 07:57 AM
  5. Error: Argument #2 is not an array in .../httpdocs/admin/infopages2.php
    By Agouti in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 30 Aug 2007, 02:53 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR