lat9:
The ordering for the $prefix and $suffix parameters to zen_get_show_product_switch and zen_get_show_product_switch_name changed going from Zen Cart 1.5.4 to 1.5.5, introducing an incompatibility for any plugin that's using one of those functions (or distributing a modified version of the admin general.php function file).:censored:
I'm hoping that there was a **really **good reason...
Yeah to have the values show grammatically correct.
There was no change in functionality and the values posted/pushed are truly the same order. But A is not a suffix to B in the following sequence just like C is not a prefix to B:
ABC
In the previous code, A was identified as a suffix to B.. Now A is actually the prefix to B and the sequence of data is no different.
See the ZC 154 version (shortened to show the "issue"):
function zen_get_show_product_switch_name($lookup, $field, $suffix= 'SHOW_', $prefix= '_INFO', $field_prefix= '_', $field_suffix='') {
/* code removed from between to show how the "suffix" and "prefix" are actually used... */
$zv_key = strtoupper($suffix . $type_handler . $prefix . $field_prefix . $field . $field_suffix);
Now see the ZC 155 version (also shortened to show... THAT THERE IS NO CHANGE):
function zen_get_show_product_switch_name($lookup, $field, $prefix= 'SHOW_', $suffix= '_INFO', $field_prefix= '_', $field_suffix='') {
/* Now note how $prefix is a prefix and $suffix is a suffix, and note how the sequence has not changed... The value(s) remain the same and are used correctly. */
$zv_key = strtoupper($prefix . $type_handler . $suffix . $field_prefix . $field . $field_suffix);
Now, go take a look at this updated "help" page and see if you would have known what data to populate in order for the function to provide the desired result if the prefix and suffix had not been swapped?