Skip to content

Commit 1fe0f9c

Browse files
ntsekourasmatticbot
authored andcommitted
Forms: Fix source filtering in classic view for responses management (#42641)
Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/14031937053 Upstream-Ref: Automattic/jetpack@fdb3704
1 parent 78090d1 commit 1fe0f9c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This is an alpha version! The changes listed here are not final.
1515

1616
### Fixed
1717
- Components: Add __next40pxDefaultSize to controls, preventing deprecation notices.
18+
- Forms: Fix `source` filtering in classic view for responses management
1819
- Forms: Prevent custom label font sizes preventing animated label font size reduction
1920
- Placeholder should always display if it's a non-empty string
2021

src/contact-form/class-admin.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,13 @@ public function grunion_source_filter_results( $query ) {
862862
return;
863863
}
864864

865-
// Don't apply to the filter dropdown query
866-
if ( $query->query_vars['fields'] === 'id=>parent' ) {
865+
/**
866+
* In the wp-admin list we perform two queries that trigger the `pre_get_posts` hook.
867+
* One is for the main list and the other is for the `source` dropdown filter.
868+
* We need to explicitly check one unique parameter between the two queries to avoid
869+
* filtering the dropdown query. The dropdown query is in `get_all_parent_post_ids`.
870+
*/
871+
if ( $query->query_vars['posts_per_page'] === 100000 ) {
867872
return;
868873
}
869874

0 commit comments

Comments
 (0)