• Resolved ddfoston

    (@fostonda)


    Hi

    For your info
    I have dubug on and I have this notice appear:

    Notice: Undefined variable: post_id in …. gravity-forms-post-updates/gravityforms-update-post.php on line 129

    For the moment it doesn’t appear to be causing a problem but thought you should know.

    Apart from that it seems to be working fine – very useful plugin – Thanks!
    Dave

    https://www.ads-software.com/plugins/gravity-forms-post-updates/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Me too.

    Notice: Undefined variable: post_id in /wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 146

    Changing gravityforms-update-post.php line 113 from a blank line to $post_id = false; resolved the issue for me.

    I also got this WP_DEBUG message at time of clicking Submit button on a form:

    Notice: Undefined index: post_content in /wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 1150

    I resolved it by changing line 1150 from this:
    if (! $post_data['post_content'] ) {
    to this:
    if (isset($post_data['post_content']) && ! $post_data['post_content'] ) {

    Thread Starter ddfoston

    (@fostonda)

    That’s how I’d solved the first issue. Hadn’t got to the second but thanks on the heads-up Clifford. Well done.

    I had been seeing the 1st error consistently. Then all of a sudden I noticed the 2nd. If I remember correctly, I think it’s upon submitting a form, which could easily be missed on a long form (appears at bottom I think, maybe at top of form) and appears just for a flash if page reloads or Ajax. Sorry can’t remember all the details, but it was appearing consistently.

    Thread Starter ddfoston

    (@fostonda)

    Ok Clifford – I’ll look out for it
    Thanks

    Plugin Author Jupitercow

    (@jcow)

    Updated in the new version.

    Thread Starter ddfoston

    (@fostonda)

    Thanks guys

    Thanks for updating with this fix.

    You should also change the “Compatible up to: 4.1.5” to the current WP version to avoid the scary “Warning: This plugin has not been tested with your current version of WordPress” message.

    Another one appeared above where displaying the form (i.e. updating a post):

    Notice: Undefined index: conditional in /wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 935

    Thread Starter ddfoston

    (@fostonda)

    Clifford

    I did a temporary fix by changing the condition of the if statement on that line from
    if (! $form['conditional'] ) { to

    if (empty($form['conditional'] )) {

    as this seems to be the gist of what is being queried.

    There are other lines giving warnings and I think these happen when loading a form with empty fields.

    Sorry for the late response. Yup, that fixed the issue of the WP_DEBUG message flashing at the bottom of the screen/submit button when updating a post.

    tyvm! ??

    Plugin Author Jupitercow

    (@jcow)

    I added this into the latest version. Thanks for highlighting it.

    ??

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Undeclared variable notice’ is closed to new replies.