Skip to:
Content

BuddyPress.org

Opened 3 months ago

Closed 3 months ago

#9195 closed defect (bug) (fixed)

[BP Tools - Manage Opt-outs] Unable to save Screen Options Pagination value

Reported by: emaralive's profile emaralive Owned by: imath's profile imath
Milestone: 14.0.0 Priority: normal
Severity: normal Version: 12.5.1
Component: Administration Keywords: has-screenshots has-patch commit
Cc:

Description

The issue is the inability to save the Screen Options Pagination value for the BuddyPress Tools Manage Opt-outs page/screen. The issue can be replicated by going to site.url/wp-admin/tools.php?page=bp-optouts:

  • Select Screen Options tab.
  • Change the pagination value.
  • Click Apply

You should notice that the Pagination default value of 20 remains unchanged (see screenshot - screenshot-win10-me-2024.06.19-06_56_23.png for reference).

The the patch adds a callback and filter hook set-screen-option, which fixes the issue (see screenshot - screenshot-win10-me-2024.06.19-07_11_33.png).

Attachments (4)

screenshot-win10-me-2024.06.19-06_56_23.png (188.1 KB) - added by emaralive 3 months ago.
screenshot-win10-me-2024.06.19-06_56_23.png
screenshot-win10-me-2024.06.19-07_11_33.png (184.0 KB) - added by emaralive 3 months ago.
screenshot-win10-me-2024.06.19-07_11_33.png
9195.01.patch (1.4 KB) - added by emaralive 3 months ago.
Initial patch
9195.02.patch (6.2 KB) - added by imath 3 months ago.

Download all attachments as: .zip

Change History (9)

@emaralive
3 months ago

screenshot-win10-me-2024.06.19-06_56_23.png

@emaralive
3 months ago

screenshot-win10-me-2024.06.19-07_11_33.png

@emaralive
3 months ago

Initial patch

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


3 months ago
#1

This avoids code duplication.

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

@imath
3 months ago

#2 @imath
3 months ago

  • Keywords 2nd-opinion added

Hi @emaralive

Thanks a lot for this new catch. Patch is fine and is in line with the way we deal with the screen options.

I believe we can improve it a bit by avoiding code duplication using one & only one callback function to deal with every BP Admin Screen.

I have tested for Activity and Groups Admin Screen, could you test 9195.02.patch with the Opt-outs one to see if it's also behaving the right way?

Thanks in advance for your help.

#3 @emaralive
3 months ago

Hi @imath,

Tested the patch (9195.02.patch) and it works well. However, along the way, I discovered that there is another place where screen pagination doesn't save, .i.e., site.url/wp-admin/tools.php?page=bp-members-invitations (BP Tools - Manage Invitations) and based on the new central function scheme there should be 2 (two) more entries for filter hooks:

add_filter( 'set_screen_option_tools_page_bp_members_invitations_per_page', 'bp_admin_set_screen_options', 10, 3 );
add_filter( 'set_screen_option_tools_page_bp_members_invitations_network_per_page', 'bp_admin_set_screen_options', 10, 3 );

I'm not sure if you need another ticket or not. Perhaps, you can just slide it into PR #320. Thoughts?

Last edited 3 months ago by emaralive (previous) (diff)

#4 @imath
3 months ago

  • Keywords commit added; dev-feedback 2nd-opinion removed

I agree! Thanks a lot for your feedback @emaralive I'm updating the PR and will commit it right after 👍

#5 @imath
3 months ago

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

In 13937:

Manage BP specific WP List Tables pagination from a central function

  • Introduces bp_admin_set_screen_options() to deal with WP List Table pagination

for Activity, Groups, Opt-outs & Site Invitations.

  • Deprecates bp_activity_admin_screen_options() & bp_groups_admin_screen_options().

Props emaralive

Fixes #9195
Closes https://github.com/buddypress/buddypress/pull/320

Note: See TracTickets for help on using tickets.