WPIntell

Source evidence

Found issue with PHP 7.1+

Gravity Forms: Post Updates · support · 2018-06-07T15:58:00+00:00

complaintsentiment
highseverity
0.96relevance
7replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 25 rows with source links

20.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Brett Wysocki unresolved
There’s an issue on line 1025 in gravityforms-update-post.php where the declared variable in the use() is the same as the declared parameter in the anonymous function. Here’s the error I recieved in testing (using PHP Compatibility Checker ): 1025 | ERROR | Variables bound to a closure via the use construct cannot use the same name as superglobals, $this, or a declared parameter since PHP 7.1. Here’s what that line looks like: add_filter( 'gform_field_value_' . $field['inputName'], function($value) use($value) { return $value; } ); All I did was change the declared variable and return variable from $value to $val , and it seems to fix the issue: add_filter( 'gform_field_value_' . $field['inputName'], function($val) use($value) { return $val; } ); Yes same issue with php 7.2. This fix fixed issue on php 7.2 lauzis, Are you saying that if we are using 7.2. this error is not an issue? Or that it is still an issue? I also found this using the PHP Compatibility Checker. Hoping that it won’t be an issue! Does anyone have a solution? I’m running php 7.2 and get the following error: Fatal error: Cannot use lexical variable $value as a parameter name in /nas/content/staging/scribetribenew/wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 1021 Doing the above fix of changing $value to $val only changed the error to this: Cannot use lexical variable $val as a parameter name in /nas/content/staging/scribetribenew/wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 1021 Please help! ====== UPDATE ====== FOUND THE SOLUTION HERE: https://github.com/jupitercow/gravity-forms-post-updates/issues/16 Replace with: add_filter( ‘gform_field_value_’ . $field[‘inputName’], function($v) use($value) { return $v; } ); This reply was modified 7 years, 2 months ago by alexwilk . This reply was modified 7 years, 2 months ago by alexwilk . THANK YOU SO MUCH!!! Yes Thank you very much! I got my site down this morning because of that issue and was able to fix it in minutes… OMG! Thank you, thank you, THAAAAANK YOU!! 🙂

Comments

7 shown
lauzis 2018-10-03T08:02:00+00:00

Yes same issue with php 7.2. This fix fixed issue on php 7.2

relish1227 2018-11-26T16:22:00+00:00

lauzis, Are you saying that if we are using 7.2. this error is not an issue? Or that it is still an issue? I also found this using the PHP Compatibility Checker. Hoping that it won’t be an issue!

codeink 2018-12-04T00:34:00+00:00

Does anyone have a solution?

alexwilk 2019-03-23T09:50:00+00:00

I’m running php 7.2 and get the following error: Fatal error: Cannot use lexical variable $value as a parameter name in /nas/content/staging/scribetribenew/wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 1021 Doing the above fix of changing $value to $val only changed the error to this: Cannot use lexical variable $val as a parameter name in /nas/content/staging/scribetribenew/wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 1021 Please help! ====== UPDATE ====== FOUND THE SOLUTION HERE: https://github.com/jupitercow/gravity-forms-post-updates/issues/16 Replace with: add_filter( ‘gform_field_value_’ . $field[‘inputName’], function($v) use($value) { return $v; } ); This reply was modified 7 years, 2 months ago by alexwilk . This reply was modified 7 years, 2 months ago by alexwilk .

relish1227 2019-03-28T04:21:00+00:00

THANK YOU SO MUCH!!!

Accur 2019-03-28T14:46:00+00:00

Yes Thank you very much! I got my site down this morning because of that issue and was able to fix it in minutes…

kalledrengennr1 2019-04-26T12:32:00+00:00

OMG! Thank you, thank you, THAAAAANK YOU!! 🙂