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.
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_...tock.php#L1489
Re: Functions removed from 1.5.8 - discussion
Quote:
Originally Posted by
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.
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.
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.
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
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/
Re: Functions removed from 1.5.8 - discussion
Quote:
Originally Posted by
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_...tock.php#L1489
Quote:
Originally Posted by
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_...75a7eb5934f1b0
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.
Re: Functions removed from 1.5.8 - discussion
Quote:
Originally Posted by
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/functi...-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