If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading Your Zen Cart / Upgrading to 1.5.x / Functions removed from 1.5.8 - discussion

Functions removed from 1.5.8 - discussion

Started by swguy on 2 Dec 2022, 11:24 AM · Views: 2,136

Results 1 to 10 of 10
2 Dec 2022, 11:24 AM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Functions removed from 1.5.8 - discussion

During what might have been overzealous culling, the following functions were removed from the code base in 1.5.8.

  • zen_draw_products_pull_down
  • zen_draw_products_pull_down_attributes
  • zen_draw_products_pull_down_categories
  • zen_draw_products_pull_down_categories_attributes

Did this hit one of your plugins? Please comment below.

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.

2 Dec 2022, 7:38 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Functions removed from 1.5.8 - discussion

It will in stock by attributes in one place, I expect to use a function_exists test to work around that issue, though need to look at how the feature is now implemented.

Github location of what will be problematic is: https://github.com/mc12345678/Stock_By_Attributes_Combined/blob/a0f94d35d531a77680ded4f26f4432003eba31ca/admin/products_with_attributes_stock.php#L1489

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

3 Dec 2022, 12:16 AM
#3
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: Functions removed from 1.5.8 - discussion

swguy:

During what might have been overzealous culling, the following functions were removed from the code base in 1.5.8.

  • zen_draw_products_pull_down
  • zen_draw_products_pull_down_attributes
  • zen_draw_products_pull_down_categories
  • zen_draw_products_pull_down_categories_attributes

Did this hit one of your plugins? Please comment below.

i would disagree with the assessment of "overzealous culling."

it seems these functions were merely renamed. their function signatures remain unchanged.

see this commit.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

3 Dec 2022, 1:19 AM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Functions removed from 1.5.8 - discussion

Thanks for tracking that down.
We might want to have a compatibility layer so that plugins won't be broken. We could issue a deprecated log. Will noodle on it.

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.

3 Dec 2022, 11:53 AM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Functions removed from 1.5.8 - discussion

LOL in the original PR #4083 created by @drbyte, I said, "uhh... we'll break plugins," and Cindy agreed.

PR #5439 created.

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.

3 Dec 2022, 5:57 PM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Functions removed from 1.5.8 - discussion

OK PR 5439 has been merged, so this will be the resolution.

If you are upgrading a plugin and need these functions, please see
https://github.com/zencart/zencart/pull/5439/files

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.

3 Dec 2022, 6:33 PM
#7
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Functions removed from 1.5.8 - discussion

If you are writing software to run on both Zen Cart 1.5.8 and older versions, you can use function_exists to determine the correct function to call, or you can use version checking logic:

https://docs.zen-cart.com/dev/plugins/version/

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.

10 Dec 2022, 1:56 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Functions removed from 1.5.8 - discussion

mc12345678:

It will in stock by attributes in one place, I expect to use a function_exists test to work around that issue, though need to look at how the feature is now implemented.

Github location of what will be problematic is: https://github.com/mc12345678/Stock_By_Attributes_Combined/blob/a0f94d35d531a77680ded4f26f4432003eba31ca/admin/products_with_attributes_stock.php#L1489

swguy:

If you are writing software to run on both Zen Cart 1.5.8 and older versions, you can use function_exists to determine the correct function to call, or you can use version checking logic:

https://docs.zen-cart.com/dev/plugins/version/

I accomplished this using the following: https://github.com/mc12345678/Stock_By_Attributes_Combined/commit/a8341e6d4a5775d024af263dc175a7eb5934f1b0

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

10 Dec 2022, 5:06 PM
#9
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Functions removed from 1.5.8 - discussion

Very elegant! I didn't even know function pointers were a thing in PHP.

I think this might be too complicated for the documentation, but thanks for sharing it.

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.

10 Dec 2022, 7:52 PM
#10
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Functions removed from 1.5.8 - discussion

swguy:

Very elegant! I didn't even know function pointers were a thing in PHP.

I think this might be too complicated for the documentation, but thanks for sharing it.

Technically termed variable functions: https://www.php.net/manual/en/functions.variable-functions.php

And in this case seemed like a suitable method considering the function definition was the same for both. Otherwise might get complicated if individual if statements were used within the call or might have gotten busy if two separate calls were captured in an if/else situation

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