Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice: Trying to get property of non-object #18

Open
dwaqaddi opened this issue Mar 11, 2015 · 4 comments
Open

Notice: Trying to get property of non-object #18

dwaqaddi opened this issue Mar 11, 2015 · 4 comments

Comments

@dwaqaddi
Copy link

Hi Elliot,

I'm experiencing and issue with the plugin. It generates this error:

Notice: Trying to get property of non-object in /home/comonede/MesSites/travelersparking.com/wp-content/themes/travellers/inc/partials/gravity_form_code.php on line 4

Notice: Trying to get property of non-object in /home/comonede/MesSites/travelersparking.com/wp-content/themes/travellers/inc/partials/gravity_form_code.php on line 5

Oops! We could not locate your form.

"gravity_form_code.php" contains the code below:

<div>
    <?php 
        $form = get_sub_field('custom_form_gravity');
        gravity_form_enqueue_scripts($form->id, true);
        gravity_form($form->id, true, true, true, '', true, 1); 
    ?>
</div>

When i try to var_dump($form). it only returns:

string(3331) ""

Im using the acf gravity form plugin inside "acf flexible content". Acf version is 4.4.0 and Gravity is 1.9.

Thanks,
Darwin

@bhargavy
Copy link

I'M getting the Same error.

@Marcoevich
Copy link
Contributor

This should now be fixed. Can you please try with the latest version of this plugin?

Thanks!

@tiborp
Copy link

tiborp commented May 13, 2015

I am having the same notices with the latest version of the plugin, GF version 1.9.8 and ACF 5.2.5

var_dump($form) returns:

array(1) { [0]=> array(40) { ["title"]=> string(7) "Contact" ....etc. }

(removed biggest part of the returned array for readability)

Any ideas?

Thx!

@tiborp
Copy link

tiborp commented May 13, 2015

Update: I fixed this by using this:

`

`
in my template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants