Skip to:
Content

BuddyPress.org

Opened 5 years ago

Last modified 5 months ago

#8319 reopened enhancement

Block based Activity post form

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Activity Keywords: has-patch
Cc:

Description (last modified by imath)

The BP Activity Block Editor is being developed from GitHub as a feature as a plugin:

https://github.com/buddypress/bp-activity-block-editor

Change History (26)

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


5 years ago

#2 @imath
4 years ago

I've just added a block to share a post/page via the activity stream that used the Block Based Activity Post form into a modal. This gives you a preview of how we could slowly introduce this new post form into 7.0.0.

For more info about this: https://github.com/buddypress/bp-blocks/pull/11

#3 @imath
4 years ago

  • Keywords has-patch removed
  • Milestone changed from 7.0.0 to Up Next

The pull request has been merged into the BP Blocks plugin. We made great progress during the 7.0.0 development cycle. The Activity post form made it possible to add a block to share a post/page into the activity stream. @espellcaste brought great improvements to the plugin organization lately, but we need more time to :

Let's work on it to try to have it ready for 8.0.0

#4 @imath
4 years ago

  • Milestone changed from Up Next to 8.0.0

This ticket was mentioned in Slack in #buddypress by vapvarun. View the logs.


4 years ago

#6 @imath
4 years ago

  • Milestone changed from 8.0.0 to Awaiting Contributions

We need more time to progress on this.

#7 @imath
13 months ago

  • Milestone changed from Awaiting Contributions to 14.0.0

This ticket was mentioned in Slack in #buddypress by emaralive. View the logs.


10 months ago

#9 @imath
9 months ago

  • Description modified (diff)

#10 @imath
9 months ago

Here's a screenshot of the Block Activity Editor.

https://i.imgur.com/qimJGbt.png

Progress:
[x] Activity WP Admin screen posting
[x] Editing an Activity from the Activity WP Admin screen.
[x] Replying to an Activity from the Activity WP Admin screen.
[x] Front-end posting (Directory, User profile, Group profile)
[x] Emojis Autocompleter
[x] 3rd party Activity Blocks (Test with the BP Attachments Add-on)
[x] Theme Compat Feature check
[x] Improvements to buddypress Theme Support to let themes opt-in to support the Activity Block Editor.
[ ] Activity WP Admin screen: build an Activity stream using the BP REST API to let any member share their content from there as well as let Community Admins moderate posted activities from there (load-more, favorite, delete, search, filters...)

Test it! -> https://github.com/buddypress/bp-activity-block-editor

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


9 months ago

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


8 months ago

This ticket was mentioned in PR #301 on buddypress/buddypress by imath.


8 months ago
#13

  • Keywords has-patch has-unit-tests added

This PR is extending the WP theme supports API to be able to check Standalone themes opted in for BP Modern features such as the Activity Block Editor.

Usage in theme:

add_theme_support(
        'buddypress',
        array(
                'activity'     => array( 'block-editor' ),
                'messages => array( 'pagination' ),
        )
);

Usage in BuddyPress:

if ( bp_current_theme_supports( array( 'activity' => 'block-editor' ) ) ) {}

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8319

#14 @imath
7 months ago

In 13912:

Introduce theme support check for specific component features

Some of the feature we'll soon introduce like the Block based activity post form will need standalone BP themes to do some adjustments to their code to support them.

Once done, they'll need to opt-in for these features using the WordPress add_theme_support() function. The first argument for this function remains buddypress. Supporting BP component specific features will need to use a second argument: an associative array keyed by BP Component IDs. For instance, it will be array( 'activity' => array( 'block-editor' ) ) when a theme support the future Block based activity post form.

In BuddyPress code, we'll then be able for example to use the following kind of check bp_current_theme_supports( array( 'activity' => 'block-editor' ) ) to be sure the theme fully support the feature.

Props espellcaste

See #8319
Closes https://github.com/buddypress/buddypress/pull/301

#15 @imath
7 months ago

  • Keywords has-patch has-unit-tests removed
  • Milestone changed from 14.0.0 to Up Next

Other needed code improvements for the Block Based activity post form will happen during next major release.

#16 @dd32
7 months ago

In [13912]:
Introduce theme support check for specific component features

@imath This has introduced PHP warnings with profiles.w.org using the bp-default parent template.

E_WARNING: array_keys() expects parameter 1 to be array, bool given in wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php:1093
E_WARNING: array_map(): Expected parameter 2 to be an array, null given in wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php:1093
E_WARNING: array_filter() expects parameter 1 to be array, null given in wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php:1093

https://github.com/buddypress/buddypress/blob/f6ebb51eda2c5648f91a18666ccf5068fdca7e0d/src/bp-core/bp-core-theme-compatibility.php#L1091-L1093

What this boils down to is, $args is array(), reset( array() ) is false, array_keys( false ) is a warning and returns null.

Quick fix would be

- $params             = reset( $args );
+ $params             = reset( $args ) ?: [];

or

        $params             = reset( $args );
-       $is_expected_params = array_filter( array_map( 'is_string', array_keys( $params ) ) );
+       $is_expected_params = $params && array_filter( array_map( 'is_string', array_keys( $params ) ) );

Stack trace:

array_keys() wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php:1093
_bp_filter_current_theme_supports() wp-includes/class-wp-hook.php:324
apply_filters('current_theme_supports-buddypress') wp-includes/theme.php:3174
current_theme_supports() wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php:207
bp_detect_theme_compat_with_current_theme() wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php:169
bp_use_theme_compat_with_current_theme() wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php:802
bp_load_theme_functions() wp-includes/class-wp-hook.php:324
do_action('bp_after_setup_theme') wp-content/plugins/buddypress/bp-core/bp-core-dependency.php:643
bp_after_setup_theme() wp-includes/class-wp-hook.php:324
do_action('after_setup_theme') wp-settings.php:678
Last edited 7 months ago by dd32 (previous) (diff)

#17 @imath
7 months ago

  • Milestone changed from Up Next to 14.0.0

Ouch!! Thanks for the alert, it shouldn't according to our unit tests. I guess I missed something. Let's fix it before 14.0.0-beta2

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.


7 months ago

This ticket was mentioned in PR #317 on buddypress/buddypress by imath.


7 months ago
#19

  • Keywords has-patch added

When first activating the BP Default theme, more than PHP warnings we get a fatal error.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8319

imath commented on PR #317:


7 months ago
#20

Hi @dd32 thanks a lot for your feedback 😍, yes I got the fatal in PHP8! I'm going to commit the fix asap.

#21 @imath
7 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 13932:

Improve how BP extends the WP Theme Support for BP Standalone Themes

To be able to check whether a BP Standalone theme supports future specific BP Component features, we are filtering current_theme_supports-buddypress using the _bp_filter_current_theme_supports() callback function.

When a theme (eg: BP Default theme) was adding a buddypress support with no extra arguments, this callback was wrongly generating PHP errors when the extra arguments were empty.

This commit is making sure these errors are gone!

Props dd32

Fixes #8319
Closes https://github.com/buddypress/buddypress/pull/317

#22 @imath
7 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#23 @imath
7 months ago

  • Milestone changed from 14.0.0 to Up Next

#24 @imath
7 months ago

  • Milestone changed from Up Next to 15.0.0

This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.


5 months ago

#26 @imath
5 months ago

  • Milestone changed from 15.0.0 to Awaiting Contributions
Note: See TracTickets for help on using tickets.