[buddypress-trac] [BuddyPress Trac] #9008: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in class-bp-signup.php

buddypress-trac noreply at wordpress.org
Tue Oct 17 19:44:34 UTC 2023


#9008: PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string
on string in class-bp-signup.php
--------------------------+-----------------------------
 Reporter:  btray900      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Members       |    Version:  11.3.1
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 PHP Version: 8.1.2
 WP Version: 6.3.2
 BP Version: 11.3.1

 Using the {{{wp bp signup create}}} CLI, a type error is throw for the
 {{{meta}}} array.

 {{{
 wp bp signup create --user-login=amthompson23 --user-
 email=amthompson23 at email.com.com --path=/var/www/legacy/wordpress

 PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string
 on string in /var/www/legacy/wordpress/wp-content/plugins/buddypress/bp-
 members/classes/class-bp-signup.php:469
 Stack trace:
 #0 /var/www/legacy/wordpress/wp-
 content/plugins/buddypress/cli/src/signup.php(106): BP_Signup::add()
 #1 [internal function]: Buddypress\CLI\Command\Signup->create()
 #2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-
 cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
 #3 [internal function]:
 WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}()
 #4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-
 cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
 #5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-
 cli/php/WP_CLI/Runner.php(431): WP_CLI\Dispatcher\Subcommand->invoke()
 #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-
 cli/php/WP_CLI/Runner.php(454): WP_CLI\Runner->run_command()
 #7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-
 cli/php/WP_CLI/Runner.php(1269): WP_CLI\Runner->run_command_and_exit()
 #8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-
 cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
 #9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(83):
 WP_CLI\Bootstrap\LaunchRunner->process()
 #10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32):
 WP_CLI\bootstrap()
 #11 phar:///usr/local/bin/wp/php/boot-phar.php(20): include('...')
 #12 /usr/local/bin/wp(4): include('...')
 #13 {main}
   thrown in /var/www/legacy/wordpress/wp-content/plugins/buddypress/bp-
 members/classes/class-bp-signup.php on line 469
 }}}

 Diff:

 {{{
 diff --git a/src/bp-members/classes/class-bp-signup.php b/src/bp-
 members/classes/class-bp-signup.php
 index 26c12b756..0e043b6ce 100644
 --- a/src/bp-members/classes/class-bp-signup.php
 +++ b/src/bp-members/classes/class-bp-signup.php
 @@ -480,10 +480,10 @@ class BP_Signup {
                 );

                 // Ensure that sent_date and count_sent are set in meta.
 -               if ( ! isset( $r['meta']['sent_date'] ) ) {
 +               if ( is_array($r['meta']) && ! isset(
 $r['meta']['sent_date'] ) ) {
                         $r['meta']['sent_date'] = '0000-00-00 00:00:00';
                 }
 -               if ( ! isset( $r['meta']['count_sent'] ) ) {
 +               if ( is_array($r['meta']) && ! isset(
 $r['meta']['count_sent'] ) ) {
                         $r['meta']['count_sent'] = 0;
                 }
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9008>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list