Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/01/2024 06:07:04 AM (13 months ago)
Author:
imath
Message:

Improve BuddyPress compatibility with WP Playground previews

  • Avoid using SIGNED casting into the SQL query retrieving the signup field IDs as it's generating an error with WP Playground SQLite db.
  • Make sure BP URI globals are set during Ajax requests passing the current displayed page canonical URL into these requests.
  • Ignore the bp-message cookie when its value is set to deleted to prevent the wrong display of a template notice when BP Legacy is the active template pack.
  • Update JSON blueprints to latest WP Playground's blueprint schema.

Props espellcaste

Fixes #9207
Closes https://github.com/buddypress/buddypress/pull/389

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/xprofile/functions.php

    r13980 r14068  
    14211421        $this->assertEquals( '', $updated_u->last_name );
    14221422    }
     1423
     1424    /**
     1425     * @ticket BP9207
     1426     */
     1427    public function test_bp_xprofile_get_signup_field_ids() {
     1428        add_filter( 'bp_get_signup_allowed', '__return_true' );
     1429        $signup_test_group = self::factory()->xprofile_group->create();
     1430
     1431        $third = self::factory()->xprofile_field->create(
     1432            array(
     1433                'field_group_id' => $signup_test_group,
     1434                'type'           => 'textbox',
     1435                'name'           => 'thirdPosition'
     1436            )
     1437        );
     1438
     1439        $first = self::factory()->xprofile_field->create(
     1440            array(
     1441                'field_group_id' => $signup_test_group,
     1442                'type'           => 'textbox',
     1443                'name'           => 'firstPosition'
     1444            )
     1445        );
     1446
     1447        $tenth = self::factory()->xprofile_field->create(
     1448            array(
     1449                'field_group_id' => $signup_test_group,
     1450                'type'           => 'textbox',
     1451                'name'           => 'tenthPosition'
     1452            )
     1453        );
     1454
     1455        // Set order.
     1456        bp_xprofile_update_field_meta( $first, 'signup_position', 1 );
     1457        bp_xprofile_update_field_meta( 1, 'signup_position', 2 );
     1458        bp_xprofile_update_field_meta( $third, 'signup_position', 3 );
     1459        bp_xprofile_update_field_meta( $tenth, 'signup_position', 10 );
     1460
     1461        $this->assertSame( bp_xprofile_get_signup_field_ids(), array( $first, 1, $third, $tenth ) );
     1462
     1463        xprofile_delete_field_group( $signup_test_group );
     1464        remove_filter( 'bp_get_signup_allowed', '__return_true' );
     1465    }
    14231466}
Note: See TracChangeset for help on using the changeset viewer.