Home Forums WoodMart support forum woodmart_get_dropdown_param function throws deprecation notice

woodmart_get_dropdown_param function throws deprecation notice

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #347497

    horny_fungus
    Participant

    Hi, when I open in WPbakery extra menu list element settings and click label color drop-down following PHP notice is thrown:

    PHP Deprecated:  Invalid characters passed for attempted conversion, these have been ignored in /public_html/wp-content/plugins/woocommerce/includes/wc-formatting-functions.php on line 915
     Stack trace:
       1. {main}() /public_html/wp-admin/admin-ajax.php:0
       2. do_action($hook_name = 'wp_ajax_vc_edit_form') /public_html/wp-admin/admin-ajax.php:187
       3. WP_Hook->do_action($args = [0 => '']) /public_html/wp-includes/plugin.php:470
       4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /public_html/wp-includes/class-wp-hook.php:327
       5. Vc_Shortcode_Edit_Form->renderFields('') /public_html/wp-includes/class-wp-hook.php:303
       6. Vc_Edit_Form_Fields->render() /public_html/wp-content/plugins/js_composer/include/classes/editors/popups/class-vc-shortcode-edit-form.php:71
       7. Vc_Edit_Form_Fields->renderField($param = ['type' => 'woodmart_dropdown', 'heading' => 'Label color', 'param_name' => 'label', 'value' => ['Primary Color' => 'primary', 'Secondary' => 'secondary', 'Red' => 'red', 'Green' => 'green', 'Blue' => 'blue', 'Orange' => 'orange', 'Grey' => 'grey', 'White' => 'white', 'Black' => 'black'], 'style' => ['primary' => 'rgb(221,175,106)', 'secondary' => 'rgb(96,152,225)', 'red' => '#D41212', 'green' => '#65B32E', 'blue' => '#00A1BE', 'orange' => '#fbbc34', 'grey' => '#ECECEC', 'black' => '#000000'], 'edit_field_class' => 'vc_col-sm-6 vc_column'], $value = 'primary') /public_html/wp-content/plugins/js_composer/include/classes/editors/class-vc-edit-form-fields.php:237
       8. vc_do_shortcode_param_settings_field($name = 'woodmart_dropdown', $param_settings = ['type' => 'woodmart_dropdown', 'heading' => 'Label color', 'param_name' => 'label', 'value' => ['Primary Color' => 'primary', 'Secondary' => 'secondary', 'Red' => 'red', 'Green' => 'green', 'Blue' => 'blue', 'Orange' => 'orange', 'Grey' => 'grey', 'White' => 'white', 'Black' => 'black'], 'style' => ['primary' => 'rgb(221,175,106)', 'secondary' => 'rgb(96,152,225)', 'red' => '#D41212', 'green' => '#65B32E', 'blue' => '#00A1BE', 'orange' => '#fbbc34', 'grey' => '#ECECEC', 'black' => '#000000'], 'edit_field_class' => 'vc_col-sm-6 vc_column', 'vc_single_param_edit_holder_class' => [0 => 'vc_col-sm-6 vc_column', 1 => 'wpb_el_type_woodmart_dropdown', 2 => 'vc_wrapper-param-type-woodmart_dropdown', 3 => 'vc_shortcode-param', 4 => 'vc_column']], $param_value = 'primary', $tag = 'extra_menu') /public_html/wp-content/plugins/js_composer/include/classes/editors/class-vc-edit-form-fields.php:283
       9. WpbakeryShortcodeParams::renderSettingsField($name = 'woodmart_dropdown', $param_settings = ['type' => 'woodmart_dropdown', 'heading' => 'Label color', 'param_name' => 'label', 'value' => ['Primary Color' => 'primary', 'Secondary' => 'secondary', 'Red' => 'red', 'Green' => 'green', 'Blue' => 'blue', 'Orange' => 'orange', 'Grey' => 'grey', 'White' => 'white', 'Black' => 'black'], 'style' => ['primary' => 'rgb(221,175,106)', 'secondary' => 'rgb(96,152,225)', 'red' => '#D41212', 'green' => '#65B32E', 'blue' => '#00A1BE', 'orange' => '#fbbc34', 'grey' => '#ECECEC', 'black' => '#000000'], 'edit_field_class' => 'vc_col-sm-6 vc_column', 'vc_single_param_edit_holder_class' => [0 => 'vc_col-sm-6 vc_column', 1 => 'wpb_el_type_woodmart_dropdown', 2 => 'vc_wrapper-param-type-woodmart_dropdown', 3 => 'vc_shortcode-param', 4 => 'vc_column']], $param_value = 'primary', $tag = 'extra_menu') /public_html/wp-content/plugins/js_composer/include/helpers/helpers_api.php:819
      10. woodmart_get_dropdown_param($settings = ['type' => 'woodmart_dropdown', 'heading' => 'Label color', 'param_name' => 'label', 'value' => ['Primary Color' => 'primary', 'Secondary' => 'secondary', 'Red' => 'red', 'Green' => 'green', 'Blue' => 'blue', 'Orange' => 'orange', 'Grey' => 'grey', 'White' => 'white', 'Black' => 'black'], 'style' => ['primary' => 'rgb(221,175,106)', 'secondary' => 'rgb(96,152,225)', 'red' => '#D41212', 'green' => '#65B32E', 'blue' => '#00A1BE', 'orange' => '#fbbc34', 'grey' => '#ECECEC', 'black' => '#000000'], 'edit_field_class' => 'vc_col-sm-6 vc_column', 'vc_single_param_edit_holder_class' => [0 => 'vc_col-sm-6 vc_column', 1 => 'wpb_el_type_woodmart_dropdown', 2 => 'vc_wrapper-param-type-woodmart_dropdown', 3 => 'vc_shortcode-param', 4 => 'vc_column']], $value = 'primary', 'extra_menu') /public_html/wp-content/plugins/js_composer/include/params/params.php:97
      11. wc_light_or_dark($color = 'rgb(96,152,225)', $dark = *uninitialized*, $light = *uninitialized*) /public_html/wp-content/themes/woodmart/inc/integrations/visual-composer/fields/dropdown.php:15
      12. wc_hex_is_light($color = 'rgb(96,152,225)') /public_html/wp-content/plugins/woocommerce/includes/wc-formatting-functions.php:938
      13. hexdec($hex_string = 'rg') /public_html/wp-content/plugins/woocommerce/includes/wc-formatting-functions.php:915

    Apparently, it happens because primary colors are set in Woodmart as RGB and WooCommerce function wc_light_or_dark called in Woodmart function woodmart_get_dropdown_param expects HEX.

    #347537

    Artem Temos
    Keymaster

    Hello,

    Yes, it looks like a bug. We will fix in our next theme update.

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)