• Resolved Niazai

    (@dr-hack)


    Hello,

    As PHP prior to v8 are reaching end of life , but I am still on 7.8 because of the following issue, thought it was rectified but is persistent.

    When I use PHP v8 for my site the FES Vendor Add Product Form gives following error :

     
    
    [26-Feb-2023 14:26:26 UTC] PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/wp-content/plugins/edd-fes/classes/fields/checkbox.php:123
    Stack trace: 0 /home//wp-content/plugins/edd-fes/classes/fields/checkbox.php(123): in_array('Yes', '') 1 /home//wp-content/plugins/edd-fes/classes/abstracts/class-form.php(273): FES_Checkbox_Field->render_field_frontend(6914, false) 2 /home//wp-content/plugins/edd-fes/classes/frontend/class-forms.php(357): FES_Form->render_form_frontend(6914, false) 3 /home//wp-content/themes/mayosis/fes_templates/frontend-new-product.php(3): FES_Forms->render_submission_form() 4 /home//wp-includes/template.php(785): require('/home//…') 5 /home//wp-content/plugins/edd-fes/classes/frontend/class-templates.php(161): load_template('/home//…', false) 6 /home//wp-content/plugins/edd-fes/classes/frontend/class-templates.php(112): FES_Templates->fes_locate_template(Array, true, false) 7 /home//wp-content/plugins/edd-fes/classes/frontend/class-dashboard.php(187): FES_Templates->fes_get_template_part('frontend', 'new-product') 8 /home//wp-includes/shortcodes.php(355): FES_Dashboard->display_fes_dashboard('', '', 'fes_vendor_dash…') 9 [internal function]: do_shortcode_tag(Array)

    Complete Log Paste : https://paste.drhack.net/?97c8a77804893d75#CNUSURfiFFWBeYRGFBdepK1L1wdwWsVVtzCvDjT38kPW

    On vendor add product screen I am using a ‘Checkbox’ from “Add Extension Creation Field” which I believe is giving the error, but would like help in resolving this issue. If i remove the Checkbox field , the page would load …

    But I would like to continue getting the checkbox. Where should I exlpore ?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Mihai Joldis

    (@misulicus)

    Hi @dr-hack

    Thank you for the report and we will look into it. What you can do for now is in the Checkbox field configuration, where you added your options, make sure to check at least one of them so that you have at least one of them checked by default when the user opens the Submission form.

    Plugin Support Mihai Joldis

    (@misulicus)

    Hi again @dr-hack

    A quick fix is to edit the line of code edd-fes/classes/fields/checkbox.php on line 101 and change it to the line below:

    $selected = ! empty( $this->characteristics['selected'] ) ? $this->characteristics['selected'] : array();

    Thread Starter Niazai

    (@dr-hack)

    Hello,

    Did both and now it works …Thanks alot

    regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Vendor Add Product in FES error in PHP 8’ is closed to new replies.