Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Nov 2013
    Location
    China
    Posts
    75
    Plugin Contributions
    0

    Default PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    ZC 1.5.6a not working with PHP 7.2, it will cause may PHP errors, When i change back to PHP 7.1, everything seems working good.

    [20-Feb-2019 16:03:52 UTC] Request URI: /index.php?main_page=product_info&products_id=229643, IP address: 207.46.13.229
    #1 require(/home/estand/public_html/includes/init_includes/init_sessions.php) called at [/home/estand/public_html/includes/autoload_func.php:48]
    #2 require(/home/estand/public_html/includes/autoload_func.php) called at [/home/estand/public_html/includes/application_top.php:170]
    #3 require(/home/estand/public_html/includes/application_top.php) called at [/home/estand/public_html/index.php:26]
    --> PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS - assumed 'OFFICE_IP_TO_HOST_ADDRESS' (this will throw an Error in a future version of PHP) in /home/estand/public_html/includes/init_includes/init_sessions.php on line 112.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Not that there isn't likely something that should still be done to provide a define for that constant, but could you please explain why in configuration->sessions the default of checking for the ip to host conversion has been modified from true to false.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,695
    Plugin Contributions
    123

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Be sure your copy of includes/languages/YOUR_TEMPLATE/english.php has

    require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_EMAIL_EXTRAS);
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Hi!

    I'm getting the same type of error whenever there is a sendmail event - running a new install of 1.5.6c and PHP 7.2.

    PHP Warning: Use of undefined constant EMAIL_LOGO_FILENAME - assumed 'EMAIL_LOGO_FILENAME' (this will throw an Error in a future version of PHP) in /home/*****/public_html/includes/functions/functions_email.php on line 494.

    I checked and my English.php file does not contain the code mentioned by swguy and its not in the original English.php file either.

    Cheers
    Brinley

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,489
    Plugin Contributions
    88

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    That file (/includes/languages/english/[YOURTEMPLATE/]email_extras.php) should be loaded from the as-shipped zc156a /includes/languages/english.php file, starting at line 628:
    Code:
    ///////////////////////////////////////////////////////////
    // include email extras
      if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_EMAIL_EXTRAS)) {
        $template_dir_select = $template_dir . '/';
      } else {
        $template_dir_select = '';
      }
      require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_EMAIL_EXTRAS);
    Noting that the second constant (EMAIL_LOGO_FILENAME) is also defined in that file.

  6. #6
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Hi Lat9

    I am on 1.5.6 c and the out of the box english.php has this code on line 633 (as does my amended version)

    Code:
    ///////////////////////////////////////////////////////////
    
      $file_list = array(FILENAME_EMAIL_EXTRAS, FILENAME_HEADER, FILENAME_BUTTON_NAMES, FILENAME_ICON_NAMES, FILENAME_OTHER_IMAGES_NAMES, FILENAME_CREDIT_CARDS, FILENAME_WHOS_ONLINE, FILENAME_META_TAGS);
      foreach ($file_list as $file) {
        $file = str_replace(".php","",$file);
        require_once(zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/', $file . '.php', 'false'));
      }
    
    // END OF EXTERNAL LANGUAGE LINKS
    I assume I need to add EMAIL_LOGO_FILENAME to this.

    Cheers
    Brinley

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,489
    Plugin Contributions
    88

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Quote Originally Posted by welshop.com View Post
    Hi Lat9

    I am on 1.5.6 c and the out of the box english.php has this code on line 633 (as does my amended version)

    Code:
    ///////////////////////////////////////////////////////////
    
      $file_list = array(FILENAME_EMAIL_EXTRAS, FILENAME_HEADER, FILENAME_BUTTON_NAMES, FILENAME_ICON_NAMES, FILENAME_OTHER_IMAGES_NAMES, FILENAME_CREDIT_CARDS, FILENAME_WHOS_ONLINE, FILENAME_META_TAGS);
      foreach ($file_list as $file) {
        $file = str_replace(".php","",$file);
        require_once(zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/', $file . '.php', 'false'));
      }
    
    // END OF EXTERNAL LANGUAGE LINKS
    I assume I need to add EMAIL_LOGO_FILENAME to this.

    Cheers
    Brinley
    Brinley, you need to check your (template's?) version of /includes/languages/english/email_extras.php. That's the file that those constants (including the EMAIL_LOGO_FILENAME) are/should be defined.

  8. #8
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Just checked and I only have the original email_extras.php and english.php files as I have not made copies for my template folder within /includes/languages.

    If I do a search for using the Developer toolkit in admin the only result I get when I enter EMAIL_LOGO_FILENAME is:

    Code:
    /home/*****/public_html/includes/functions/functions_email.php
    
    Line #494 :         $block['EMAIL_LOGO_FILE'] = $domain . DIR_WS_CATALOG . 'email/' . EMAIL_LOGO_FILENAME;
    Cheers
    Brinley

  9. #9
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Quote Originally Posted by welshop.com View Post
    Just checked and I only have the original email_extras.php and english.php files as I have not made copies for my template folder within /includes/languages.

    If I do a search for using the Developer toolkit in admin the only result I get when I enter EMAIL_LOGO_FILENAME is:

    Code:
    /home/*****/public_html/includes/functions/functions_email.php
    
    Line #494 :         $block['EMAIL_LOGO_FILE'] = $domain . DIR_WS_CATALOG . 'email/' . EMAIL_LOGO_FILENAME;
    Cheers
    Brinley
    Which means that your includes/languages/english/email_extras.php file was not "upgraded" to include the define(s) expected to be present. The default install of that file includes EMAIL_LOGO_FILENAME as a define.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: PHP Warning: Use of undefined constant OFFICE_IP_TO_HOST_ADDRESS

    Hi Lat9

    Thanks - I'll check my file against the original as I have obviously deleted something I shouldn't have.

    Cheers
    Brinley

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v156 Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY
    By RixStix in forum Upgrading to 1.5.x
    Replies: 15
    Last Post: 4 Dec 2023, 05:56 PM
  2. Replies: 32
    Last Post: 6 Sep 2020, 09:03 PM
  3. v155 adding constants - PHP Notice: Use of undefined constant
    By torvista in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 4 May 2016, 07:07 AM
  4. Undefined Notice: Use of undefined constant
    By TheOracle in forum Bug Reports
    Replies: 0
    Last Post: 6 May 2007, 06:33 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