Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7919 closed defect (bug) (fixed)

Nouveau: create_screen_checked parameter for Group Type

Reported by: wbcomdesigns's profile wbcomdesigns Owned by: djpaul's profile djpaul
Milestone: 3.2.0 Priority: normal
Severity: normal Version: 3.0.0
Component: Templates Keywords: has-patch commit
Cc:

Description

create_screen_checked parameter is missing inside template files

buddypress\bp-templates\bp-nouveau\buddypress\groups\single\admin\group-settings.php

It allows to set the default group type.

It's defined inside bp_groups_register_group_type()

Attachments (3)

7919.patch (1.6 KB) - added by wbcomdesigns 6 years ago.
my suggestion to fix it
7919_1.patch (1.9 KB) - added by wbcomdesigns 6 years ago.
7919.02.patch (2.1 KB) - added by r-a-y 6 years ago.

Download all attachments as: .zip

Change History (11)

@wbcomdesigns
6 years ago

my suggestion to fix it

#1 @hnla
6 years ago

@wbcomdesigns I've just checked this, registering a group type in bp-custom.php so available across themes.

In legacy it works as expected but also it's working in Nouveau for me, can you check how you registered the group type, ensure create_screen_checked => true, repo current etc etc, I'm sure you've covered all those though so interesting to find out why working for me and not you.

@wbcomdesigns
6 years ago

#2 @wbcomdesigns
6 years ago

  • Keywords has-patch added

@hnla Please check 7919_1.patch
It's about enabling the default selected group type on create group page. You have the option to select group type at create group page, but allows site admin that some group type will show up as selected by default.

Inside Create Group Type plugin, we have the option to keep all group type as preselected, and we are going to extend it with specific group type choice inside backend.

http://screencast-o-matic.com/watch/cFi61vF4ub

#3 @r-a-y
6 years ago

The code in both bp-legacy and bp-nouveau is identical:

So if there is a bug it should occur in bp-legacy as well.

@wbcomdesigns I haven't checked yet, but can you confirm that there is a problem with bp-legacy as well?

Last edited 6 years ago by r-a-y (previous) (diff)

#4 @wbcomdesigns
6 years ago

@r-a-y Inside the legacy, we have

https://github.com/buddypress/BuddyPress/blob/42837dd8e6e7fa37b1356f7fca6c3d5cded9c164/src/bp-templates/bp-legacy/buddypress/groups/create.php
Line 159

<label for="<?php printf( 'group-type-%s', $type->name ); ?>"><input type="checkbox" name="group-types[]" id="<?php printf( 'group-type-%s', $type->name ); ?>" value="<?php echo esc_attr( $type->name ); ?>" <?php checked( true, ! empty( $type->create_screen_checked ) ); ?> /> <?php echo esc_html( $type->labels['name'] ); ?>

create_screen_checked is not used in nouveau anywhere.

#5 @r-a-y
6 years ago

  • Milestone changed from Awaiting Review to 3.2.0
  • Version set to 3.0.0

@wbcomdesigns - I can verify the problem now. Thanks for the nudge!

The issue is that Nouveau shares the group settings options output with the create output. 02.patch is a little cleaner as it moves the checked logic out of the group settings admin template and into a function.

@r-a-y
6 years ago

#6 @DJPaul
6 years ago

  • Keywords commit added

Looks good!

#7 @djpaul
6 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 12228:

Templates, Nouveau: fix group type default selection during group creation.

Nouveau shares the group settings options output with the create output. This
change moves the checked logic out of that relevant template, into a function,
to correct handle the default value for group creation vs. later group editing.

Fixes #7919

Props wbcomdesigns, r-a-y

#8 @djpaul
6 years ago

In 12229:

Templates, Nouveau: fix group type default selection during group creation.

Nouveau shares the group settings options output with the create output. This
change moves the checked logic out of that relevant template, into a function,
to correct handle the default value for group creation vs. later group editing.

Fixes #7919 (3.x branch)

Props wbcomdesigns, r-a-y

Note: See TracTickets for help on using tickets.