• Resolved websherpa

    (@websherpa)


    When I try to implement the add_filter('gfexcel_value_object', function (BaseValue $value, $field, $is_label) { to change the appearance of the Label Row in the Excel export I am given back a documented error.

    As I am not a real PHP coder, I do not understand the error or where to start looking for an issue.

    “themes/campwaterdown-peekaboo/websherpa/gravity-forms.php” is simply an include where I implement gravity forms specific functions that would otherwise be in the functions.php file.

    Plugin Version: 1.6.3
    Gravity Forms Version: 2.4.10
    PHP Version: 7.2.17
    Wordpress Version: 5.2.1
    Error message: Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of BaseValue, instance of GFExcel\Values\StringValue given, called in /home/xw4i1nu0ma7o/public_html/wp-includes/class-wp-hook.php on line 288 and defined in /home/xw4i1nu0ma7o/public_html/wp-content/themes/campwaterdown-peekaboo/websherpa/gravity-forms.php:965
    Stack trace:
    #0 /home/xw4i1nu0ma7o/public_html/wp-includes/class-wp-hook.php(288): {closure}(Object(GFExcel\Values\StringValue), Object(GF_Field), true)
    #1 /home/xw4i1nu0ma7o/public_html/wp-includes/plugin.php(208): WP_Hook->apply_filters(Object(GFExcel\Values\StringValue), Array)
    #2 /home/xw4i1nu0ma7o/public_html/wp-content/plugins/gravityforms/gravityforms.php(5791): apply_filters(‘gfexcel_value_o…’, Object(GFExcel\Values\StringValue), Object(GF_Field), true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
    #3 /home/xw4i1nu0ma7o/public_html/wp-content/plugins/gf-entries-in-excel/src/Values/BaseValue.php(74): gf_apply_filters(‘gfexcel_value_o…’, Object(GFExcel\Values\StringVal
    Error stack trace:

    #0 [internal function]: GFExcel\Renderer\AbstractPHPExcelRenderer->fatalHandler()
    #1 {main}

    Any ideas? Thank you!

    [I do understand a delay in answering given your family’s recent addition! – webSherpa]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    add use GFExcel\Values\BaseValue; under your <?php tag. The class is namespaced, so without the use statment php can’t find it ??

    Thread Starter websherpa

    (@websherpa)

    Thank you, that works! I just put it ahead of the related add_action in my functions file.

    You might want to update the FAQ for other hacks like me that wouldn’t know PHP well but still want to implement.

    Plugin Author Doeke Norg

    (@doekenorg)

    Yeah, the docs could use some work. I have a dedicated docs website that’s a bit more in depth. Perhaps you can find some useful info there. It’s my plan to let the FAQ live there too.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of Base’ is closed to new replies.