Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default PHP Deprecated: Creation of dynamic property ups::$quotes

    Hello All,
    Running ZC 1.5.8a on php8.2.4. The UPS shipping module is causing a TON of depreciation logs.

    PHP Deprecated: Creation of dynamic property ups::$quotes
    PHP Deprecated: Creation of dynamic property ups::$_upsActionCode is deprecated
    PHP Deprecated: Creation of dynamic property ups::$_upsResComCode

    etc...

    Is there a solution for this?

    Thank you,
    John

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,521
    Plugin Contributions
    88

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes


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

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    Or use PHP 8.1 until this is fixed.
    That Software Guy. My Store: Zen Cart Support
    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
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    Since the module still works, is it possible to suppress depreciation logs related to UPS?

    Thanks again,
    John

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

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    PHP 8.2 did away with log suppression and the deprecated issues with the ups.php shipping method are due to those class-based variables not being predefined.

    You could go through each of the $this->varname usages in the module and make sure that each variable is predefined within the class,

    e.g.
    Code:
    class ups {
        public
          $quotes;  // needs to be public
        protected
          $_upsActionCode,
          $_upsResComCode;
    }

  6. #6
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    So that is working... sort of. I just copied and pasted in your example like so...

    class ups extends base {
    public
    $quotes; // needs to be public
    protected
    $_upsActionCode,
    $_upsResComCode;

    This works, but when I add to the protected list $_upsPackageWeight it breaks. Clearly i'm no good working in classes. I'm going to keep at it though and see if i can figure out where these need to be added.

    Thanks again,
    John

  7. #7
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    GOT IT! Well so far... lol. I was making each protected $_var; instead of $_var, ... always with the punctuation. ;) Thank you very much.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,521
    Plugin Contributions
    88

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    Congratulations on the update! Happy to have helped.

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

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    Quote Originally Posted by lat9 View Post
    PHP 8.2 did away with log suppression
    Where is that documented? Php 8.0 removed suppression of error type messages, but not all suppression. See this portion of the php manual: https://www.php.net/manual/en/langua...rorcontrol.php

    Quote Originally Posted by lat9 View Post
    the deprecated issues with the ups.php shipping method are due to those class-based variables not being predefined.
    Which can be "temporarily" allowed without associated dynamic property log generation by using:
    #[\AllowDynamicProperties]

    As described: https://www.php.net/manual/en/class....properties.php
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,521
    Plugin Contributions
    88

    Default Re: PHP Deprecated: Creation of dynamic property ups::$quotes

    Thanks for the clarification, @mc12345678. For any PHP deprecation, though, it's best to address the issue before the deprecation turns into an error.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v157 ups has a deprecated constructor
    By Cpt Tom in forum Addon Shipping Modules
    Replies: 3
    Last Post: 31 Dec 2020, 08:41 PM
  2. Replies: 1
    Last Post: 13 Dec 2016, 01:04 AM
  3. High UPS Quotes
    By jsnacker in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 20 Aug 2009, 01:57 AM
  4. How do I get UPS and USPS quotes in Zen Cart to match USPS/UPS rates in my PayPal?
    By chachab in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 22 May 2008, 06:13 AM

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