Resolved
Reported for: Gravity Forms Multilingual 1.6.0
Resolved in: Gravity Forms Multilingual 1.6.1
Overview of the issue
If you are using the Gravity Forms User Registration Add-On and you try to add a new WordPress user, you will get this error:
PHP Fatal error: Uncaught Error: Class ‘GFSignup’ not found in /wp-content/plugins/gravityforms-multilingual/classes/compatibility/user_registration/Hooks.php:46
Workaround
Before proceeding make a full backup of your site.
- Open /wp-content/plugins/gravityforms-multilingual/classes/compatibility/user_registration/Hooks.php file.
- Look for line 42.
- Replace:
public function onActivation( $meta, WP_User $user, $update ) { if ( ! $update ) { $key = rgpost( 'key' ); // From ajax. $key = $key ?: rgpost( 'item' ); // From form submission. $signup = GFSignup::get( $key ); if ( $signup instanceof GFSignup && $signup->meta['email'] === $user->user_email ) { $meta['icl_admin_language'] = $signup->meta['icl_admin_language']; $meta['locale'] = $signup->meta['icl_admin_locale']; } } return $meta; }
- With:
public function onActivation( $meta, WP_User $user, $update ) { if ( ! $update && class_exists( 'GFSignup' ) ) { $key = rgpost( 'key' ); // From ajax. $key = $key ?: rgpost( 'item' ); // From form submission. $signup = GFSignup::get( $key ); if ( $signup instanceof GFSignup && $signup->meta['email'] === $user->user_email ) { $meta['icl_admin_language'] = $signup->meta['icl_admin_language']; $meta['locale'] = $signup->meta['icl_admin_locale']; } } return $meta; }