Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2008
    Posts
    61
    Plugin Contributions
    0

    bug 1.5.6b paypal undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG error

    PHP Version: 7.3.5-1+ubuntu16.04.1+deb.sury.org+1 (Zend: 3.3.5)
    Database Engine: MySQL 5.7.26-0ubuntu0.16.04.1
    Zen Cart 1.5.6b


    [22-Jun-2019 16:16:46 Australia/Melbourne] Request URI: /ipn_main_handler.php, IP address: 173.0.81.1
    #1 doPayPalIPNFsockopenPostback() called at [/home/****/public_html/includes/modules/payment/paypal/paypal_functions.php:463]
    #2 ipn_postback() called at [/home/****/public_html/ipn_main_handler.php:136]
    --> PHP Warning: Use of undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG - assumed 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG' (this will throw an Error in a future version of PHP) in /home/****/public_html/includes/modules/payment/paypal/paypal_functions.php on line 484.

    Using Paypal Express

    Can't roll back to PHP 5.6 but I guess it is caused by issues in PHP 7.2 - 7.3. I get a heap of these "Use of undefined constant" errors with plugins so would be nice to know process to solve them if possible for a non-programmer?

    Cheers
    Tim

  2. #2
    Join Date
    Jul 2012
    Posts
    14,077
    Plugin Contributions
    17

    Default Re: 1.5.6b paypal undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG error

    To be clear (concise?) these aren't "errors" yet... they are warnings. There is a difference and it's big. With warnings, the store/software still operates, not ideal, but it does. With errors, it's an all stop.

    Then there's a few things that can be done. From the user side, can report the issue like here, but expect to be told that possibly it has already been corrected and given the location of how/where it was fixed or expect to be given some guidance on how it likely is to be fixed in a more permanent version.

    Regardless, with so many lines of code and options, it takes the community to continue to improve on the existing code while also still developing new code that doesn't have the same problem(s).

    Could keep an eye on the various reporting locations for bugs and fixes. There are likely a number of other little things that will help
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    Dec 2008
    Posts
    61
    Plugin Contributions
    0

    Default Re: 1.5.6b paypal undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG error

    Yes just warnings but trying to keep /logs/ clean so when there is a serious error I don't miss it :)

    /public_html/includes/modules/payment/paypal/paypal_functions.php on line 484 is below:

    if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') {

    I looked at some other commits to core from mods with similar warning and maybe the below will fix but not sure if correct or backwards compatible with older PHP versions.

    if (defined('MODULE_PAYMENT_PAYPAL_IPN_DEBUG') == 'Yes') {

  4. #4
    Join Date
    Jul 2012
    Posts
    14,077
    Plugin Contributions
    17

    Default Re: 1.5.6b paypal undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG error

    Quote Originally Posted by nuganics View Post
    Yes just warnings but trying to keep /logs/ clean so when there is a serious error I don't miss it :)

    /public_html/includes/modules/payment/paypal/paypal_functions.php on line 484 is below:

    if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') {

    I looked at some other commits to core from mods with similar warning and maybe the below will fix but not sure if correct or backwards compatible with older PHP versions.

    if (defined('MODULE_PAYMENT_PAYPAL_IPN_DEBUG') == 'Yes') {
    Actually in the case of this code, if the PayPal plugin had been properly installed (meaning possibly uninstalled and then reinstalled) and this debug was still being generated, then this code:
    Code:
    if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') {
    Would become:
    Code:
    if (defined('MODULE_PAYMENT_PAYPAL_IPN_DEBUG') && MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') {
    But, seeing as this constant was incorporated earlier than in version 1.5.6, no action has been incorporated to auto-ensure that it is defied. See, previously the expected process was to reinstall payment and shipping methods. By going through the installation process after that constant had been incorporated into the code, then it would be added to the database and not need a check of whether it was defined or not.

    Basically this debug log indicates that the associated paypal method has not been installed to ensure that all database records are up-to-date. It was previously installed and upgrades were performed, but the database never received this record. So make note of your settings, remove the paypal module which is: Paypal Payments Standard from the looks of it.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,389
    Plugin Contributions
    254

    Default Re: 1.5.6b paypal undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG error

    The problem is that the functions file is common code, but the define is only created by PayPal (not EC). So the change @MC suggested is appropriate, and has been submitted for Zen Cart 1.5.7. You can make it locally now to suppress this log.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  6. #6
    Join Date
    Dec 2008
    Posts
    61
    Plugin Contributions
    0

    Default Re: 1.5.6b paypal undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG error

    Thanks guys especially the explanation.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,389
    Plugin Contributions
    254

    Default Re: 1.5.6b paypal undefined constant MODULE_PAYMENT_PAYPAL_IPN_DEBUG error

    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

 

 

Similar Threads

  1. Replies: 4
    Last Post: 10 Jul 2012, 06:10 PM
  2. Undefined constant text
    By TheOracle in forum Bug Reports
    Replies: 6
    Last Post: 11 May 2007, 04:19 AM
  3. 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