Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008
    Posts
    529
    Plugin Contributions
    0

    Default PHP Warning: Illegal offset type

    I'm get this error in my log most days, sometimes twice. Can't figure out what's up.
    [23-Jul-2015 15:47:54 America/New_York] PHP Warning: Illegal offset type in /home/***/public_html/includes/modules/shipping_estimator.php on line 132
    The code in that area is:
    Code:
    // set the cost to be able to calculate free shipping
        $order->info = array('total' => $_SESSION['cart']->show_total(), // TAX ????
                             'currency' => $currency,
                             'currency_value'=> $currencies->currencies[$currency]['value']);
    (The last line in snippet is line #132)

    I use winchester_black responsive template; Canada Post shipping mod is only shipping mod I use and it doesn't modify this file; My default currency is CAN$ and my site is CDN but my server is US.

    Thanks,
    site is meafordwool dot com

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: PHP Warning: Illegal offset type

    Quote Originally Posted by soxophoneplayer View Post
    I'm get this error in my log most days, sometimes twice. Can't figure out what's up.
    [23-Jul-2015 15:47:54 America/New_York] PHP Warning: Illegal offset type in /home/***/public_html/includes/modules/shipping_estimator.php on line 132
    This is a known problem in ZenCart V1.5.0/V1.5.1 and a very similar problem was also popping up in several other modules. At the end of the day the issue was traced back to changes made in PHP 5.4.

    As I recall, these are/were 'harmless' warnings that didn't affect functionality in any way.

    The problems that caused them were taken care of in ZenCart V1.5.4.

    This suggests that if you ARE using V1.5.4 then you didn't do a complete/full upgrade and some of your files are from an older version of zencart.

    Cheers
    RodG

  3. #3
    Join Date
    Feb 2008
    Posts
    529
    Plugin Contributions
    0

    Default Re: PHP Warning: Illegal offset type

    Quote Originally Posted by RodG View Post
    ...This suggests that if you ARE using V1.5.4 then you didn't do a complete/full upgrade and some of your files are from an older version of zencart.

    Cheers
    RodG
    Thank you for reply.

    This was a clean build with zc 1.5.4. My old 1.3.9 would have been too onerous to update so I started from scratch, with zc clean files and also all mods from scratch. Mods include: winchester_black repsonsive template, Canada Post, Stock by Attrib (github vs for 1.5.4), IH4, Flex Lang/Currencies Header, CKeditor4.5.2, Google Analytics, EZPages Metatags, and Sales Report.

    I use Firebug but haven't had any success adding an ext to let me check files for php errors, particuarly to through the mod files if core files are clean. Can you recommend a resource I can use to check php? I am not a coder; pretty much a monkey-see monkey-do guy.

    I realize it may be a non problem, but I get jittery when I open the log file to a humongous list of error messages ;o)

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: PHP Warning: Illegal offset type

    Quote Originally Posted by soxophoneplayer View Post
    This was a clean build with zc 1.5.4. My old 1.3.9 would have been too onerous to update so I started from scratch, with zc clean files and also all mods from scratch. Mods include: winchester_black repsonsive template, Canada Post, Stock by Attrib (github vs for 1.5.4), IH4, Flex Lang/Currencies Header, CKeditor4.5.2, Google Analytics, EZPages Metatags, and Sales Report.
    If I were to take a gamble, I'd say that the problem is most likely to be related to the Flex Lang/Currencies Header add-on.
    I'm not familiar with this particular addon, but the error message you are getting suggests that it could well be currency related.

    Quote Originally Posted by soxophoneplayer View Post
    I use Firebug but haven't had any success adding an ext to let me check files for php errors,
    I don't think such an extension could exist - Firefox (in fact all web browsers) can/will only 'see' the HTML output created by the PHP code, not the code itself.

    Quote Originally Posted by soxophoneplayer View Post
    Can you recommend a resource I can use to check php? I am not a coder; pretty much a monkey-see monkey-do guy.
    I'm a great fan of NetBeans. There are several other really great IDE's available though.

    Unless you can narrow down or isolate the problem by trial and error you'll need an IDE (Integrated Development system) to find the cause, as these tools allow you to step through the PHP code line by line. They can be quite daunting if you've never used one before though.

    Quote Originally Posted by soxophoneplayer View Post
    I realize it may be a non problem, but I get jittery when I open the log file to a humongous list of error messages ;o)
    Me too. Although PHP warnings generally are a non issue - it is usually just a matter of time (a future PHP upgrade) where these warnings become actual errors - and PHP errors tend to be 'fatal'.

    Other than the suggestion to use an IDE to identify the problem, there are a couple of important things to keep in mind.
    1) The 'native' code for ZenCart V1.5.4 doesn't have this problem, so with a clean install you can ignore this as a possible cause (as well as my previous suggestion about not all files were updated).

    2) Based on item#1, the problem can *only* be caused by one of your add-ons.

    On this basis, MY approach would be to disable/remove the mostly likely add-ons until the problem goes away, as that will identify the culprit. From there it is often a simple matter of identifying the actual *cause* of the error/warning.

    Based on the file and line that is *reporting* the problem (shipping_estimator.php on line 132) I'd say:

    Mods include:
    winchester_black repsonsive template: Unlikely
    Canada Post: Possibe but unlikely because this is a very popular/well used add-on (other would surely have the same issue)
    Stock by Attrib (github vs for 1.5.4): I couldn't imagine how - Discount this
    IH4: I couldn't imagine how - Discount this
    Flex Lang/Currencies Header: My prime suspect
    CKeditor4.5.2, Google Analytics, EZPages Metatags, and Sales Report.: I couldn't imagine how - Discount these.

    In short, until proven otherwise, I'm going to suggest it has something to do with the Flex Lang/Currencies Header.

    Cheers
    RodG

 

 

Similar Threads

  1. Replies: 9
    Last Post: 23 Mar 2015, 08:42 AM
  2. Replies: 4
    Last Post: 12 Nov 2014, 08:42 PM
  3. v151 PHP Warning: Illegal string offset 'r_error' in linkpoint_api.php
    By BGundlach in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 15 Sep 2014, 09:16 PM
  4. v151 PHP Warning: Illegal string offset 'id'
    By Nettric in forum Bug Reports
    Replies: 3
    Last Post: 30 May 2014, 06:53 AM
  5. Replies: 1
    Last Post: 30 Sep 2013, 07:39 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