If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Shipping Modules / PHP Deprecated: Non-static method ozpost::ozp_cfg_select_option() should not be stati

PHP Deprecated: Non-static method ozpost::ozp_cfg_select_option() should not be stati

Started by vacuumdog on 14 May 2021, 7:41 PM · Views: 2,122

Results 1 to 4 of 4
14 May 2021, 7:41 PM
#1
vacuumdog avatar

vacuumdog

New Zenner

Join Date:
Jul 2020
Location:
Traralgon
Posts:
20
Plugin Contributions:
0

Post #1 by vacuumdog

Hope I'm posting this in the right place.
Zencart version 1.5.7c

I am getting the following debug error pop up when turning ozpost postage module on/off.

[15-May-2021 04:21:39 Australia/Melbourne] Request URI: /ADMIN/index.php?cmd=modules&set=shipping&module=ozpost&action=edit, IP address: 111.208.204.181
#1 eval() called at [/users/MYSITE/public_html/ADMIN/modules.php:335]
#2 require(/users/MYSITE/public_html/ADMIN/modules.php) called at [/users/MYSITE/public_html/ADMIN/index.php:11]
--> PHP Deprecated: Non-static method ozpost::ozp_cfg_select_option() should not be called statically in /users/MYSITE/public_html/ADMIN/modules.php(335) : eval()'d code on line 1.

modules.php line 335
Is there a left parenthesis missing??

Zen Cart 2.0.1
PHP 8.3.11

14 May 2021, 8:15 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

VacuumDog:

modules.php line 335
Is there a left parenthesis missing??

No, the left-parenthesis is in the module's defined helper function as described in the db. That's normal.

.
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.

14 May 2021, 8:17 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #3 by drbyte

VacuumDog:

PHP Deprecated: Non-static method ozpost::ozp_cfg_select_option() should not be called statically

Probably the ozpost module shouldn't be using the :: syntax for calling the function.

.
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.

14 May 2021, 10:30 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #4 by mc12345678

While not familiar with the particular plugin's internals, I have resolved something like this before by modifying the code in the affected area from:

 ozpost::ozp_cfg_select_option()

to:

 $oz_var = new ozpost;
 $oz_var->ozp_cfg_select_option();

Now mind you in the above, I don't know if there are parameters that are part of the class' method or if there is some assignment being done, etc... But, doing something like the above allowed generating a variable that could be used to call the non-static method. There may be other solutions as well. Unfortunately the original author is no longer available to update the plugin.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...