Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2006
    Location
    Worcester, MA
    Posts
    453
    Plugin Contributions
    0

    Default error generated from missing LARGE_IMAGE_WIDTH constant

    One of my clients' estores is generating many error log files due to missing constant: LARGE_IMAGE_WIDTH

    Here's an example of the error:

    Code:
    PHP Warning: Use of undefined constant LARGE_IMAGE_WIDTH - assumed 'LARGE_IMAGE_WIDTH' (this will throw an Error in a future version of PHP) in /path/to/store/includes/templates/MYTEMPLATE/templates/tpl_modules_main_product_image.php on line 24.
    I did some digging in Developers Toolkit to see where this constant should be set and found some code in includes/classes/observers/FualSlimboxObserver.php which looks like it should be setting this constant:

    PHP Code:
    The constants LARGE_IMAGE_WIDTH/HEIGHT are supplied by neither Zen Cart nor Image Handler -- they're a
    // LightBox '
    legacy', I believe.  In any case, need to deal with the condition where those constants
    // haven'
    t been defined previouslyusing the IH defaults as fall-back values.
    //
    if (!defined('LARGE_IMAGE_WIDTH')) {
        
    define('LARGE_IMAGE_WIDTH', (defined('LARGE_IMAGE_MAX_WIDTH')) ? LARGE_IMAGE_MAX_WIDTH 750);
    }
    if (!
    defined('LARGE_IMAGE_HEIGHT')) {
        
    define('LARGE_IMAGE_HEIGHT', (defined('LARGE_IMAGE_MAX_HEIGHT')) ? LARGE_IMAGE_MAX_HEIGHT 550);

    The client's shop does have Image Handler 5 installed. Wondering if I can set this constant somewhere else at least temporarily to stop the barrage of error log files. But also wonder why this doesn't seem to be firing

    Any advice on how to track this error down and resolve it?
    Ellie Armsby

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: error generated from missing LARGE_IMAGE_WIDTH constant

    I'd start with exploring: in what ways has that template's tpl_modules_main_product_image.php file been modified from the original template_default version
    ... and why.
    .

    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.

  3. #3
    Join Date
    Oct 2006
    Location
    Worcester, MA
    Posts
    453
    Plugin Contributions
    0

    Default Re: error generated from missing LARGE_IMAGE_WIDTH constant

    Thanks. I should also have mentioned that the template uses zen colorbox plugin. So this file in the custom template folder is modified with that.
    Ellie Armsby

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: error generated from missing LARGE_IMAGE_WIDTH constant

    Quote Originally Posted by earmsby View Post
    Thanks. I should also have mentioned that the template uses zen colorbox plugin. So this file in the custom template folder is modified with that.
    If that plugin expects that constant to be defined (and probably via an admin config switch it adds during its installation) then perhaps there's something missing from installation steps performed?
    .

    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.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: error generated from missing LARGE_IMAGE_WIDTH constant

    Quote Originally Posted by earmsby View Post
    Thanks. I should also have mentioned that the template uses zen colorbox plugin. So this file in the custom template folder is modified with that.
    Quote Originally Posted by DrByte View Post
    If that plugin expects that constant to be defined (and probably via an admin config switch it adds during its installation) then perhaps there's something missing from installation steps performed?
    Check to be sure that the plugin is up-to-date as the current software (available from github at the moment) from what I can tell also prevents log generation using the same test for the constant being defined..

    The use of that variable is/was a carry over (from what I've been able to tell) from image handler. At least with zen_colorbox when the code was pulled out more to try to co-exist with other programs it also remained present. There is a suggested SQL to create the constant, but properly handling/use of the variable will reduce the log generation.

    Looks like I have a few plugins that need to get updated to the forum.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Replies: 16
    Last Post: 20 Jan 2019, 06:21 PM
  2. Replies: 2
    Last Post: 8 Nov 2017, 10:57 PM
  3. v154 Has there ever been a LARGE_IMAGE_WIDTH (and _HEIGHT) constant?
    By lat9 in forum Basic Configuration
    Replies: 3
    Last Post: 10 May 2015, 03:35 PM
  4. Replies: 2
    Last Post: 5 Dec 2013, 01:07 PM
  5. err: Warning: constant(): Couldn't find constant MODULE_SHIPPING_MZMT_GEOZONE_7_TEXT_
    By ginginca in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 6 Mar 2007, 07:19 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