Support » Plugin: WP Job Manager » PHP Notice: Undefined variable: Atts

  • Resolved Alan123

    (@alan123)


    Hi
    I keep getting the error:
    PHP Notice: Undefined variable: atts in wp-content/themes/jobify/inc/integrations/wp-job-manager/class-wp-job-manager.php on line 312

    Using WP Job Manager Version 1.25.0
    Jobify Theme version 2.08

    Please could you help with advice on a possible fix. Thank you

    https://wordpress.org/plugins/wp-job-manager/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Adam Heckler

    (@adamkheckler)

    Hi there!

    This was fixed in Jobify version 2.0.9. Please update to that, thanks!

    Thread Starter Alan123

    (@alan123)

    Sorry for my delayed reply. Thanks, that worked but I am still getting an error:
    PHP Notice: Trying to get property of non-object in wp-content/plugins/wp-job-manager/wp-job-manager-template.php on line 213
    Thanks

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Is there any indication on what page on your site that error is coming from? That particular line ( https://github.com/Automattic/WP-Job-Manager/blob/master/wp-job-manager-template.php#L213 ) suggests that someplace on your site is loading that function without passing a post to it or in a place that isn’t able to determine the current post.

    Thread Starter Alan123

    (@alan123)

    Hi Brandon,
    I don’t see a fault anywhere. Would you like me to forward you login details to my site?
    Thanks

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    First, what is your site’s URL? I can give it a look to see if anything stands out.

    Thread Starter Alan123

    (@alan123)

    It is http://www.jobbuddy.co.za
    Thank you

    tripflex

    (@tripflex)

    This is just a PHP warning, and any production server should always have WP_DEBUG disabled to prevent this from being output on the site, as this does not prevent the site from functioning.

    With that said, the issue is with the Jobify theme … so what you should really do is upgrade to the latest version and that will fix this, or you can just fix the part of the code that throws the warning.

    In this file
    wp-content/themes/jobify/inc/integrations/wp-job-manager/class-wp-job-manager.php around line 312

    Change this:

    function shortcode_register_form() {
                    if ( $form = $this->load_form_class( 'register' ) ) {
                            ob_start();
                           	$form->output( $atts );
                            return ob_get_clean();
                    }
            }

    To this:

    function shortcode_register_form() {
                    if ( $form = $this->load_form_class( 'register' ) ) {
                            ob_start();
                           	$form->output( array() );
                            return ob_get_clean();
                    }
            }

    As there isn’t any attributes passed to the form class, so you can just set it as an empty array.

    Thread Starter Alan123

    (@alan123)

    Thanks but that error was fixed already with Brandon…the error now is:
    PHP Notice: Trying to get property of non-object in wp-content/plugins/wp-job-manager/wp-job-manager-template.php on line 213

    Plugin Contributor Davor

    (@davoraltman)

    Hey!

    Sorry for the super late reply. This is just a PHP notice that you were receiving and it shouldn’t interfere with your site. By setting WP_DEBUG to false, the notice will be gone.

    Nevertheless, is the notice still there even with the latest WP Job Manager installed?

    Thanks,
    Davor

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘PHP Notice: Undefined variable: Atts’ is closed to new replies.