diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f2c277c..ce9e175 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- TMS-1075-fix: Program page query fix + ## [1.9.0] - 2024-10-24 - TMS-1075: Redipress 2 filters diff --git a/lib/ACF/ProgramGroup.php b/lib/ACF/ProgramGroup.php index 905d829..f48e1b0 100644 --- a/lib/ACF/ProgramGroup.php +++ b/lib/ACF/ProgramGroup.php @@ -87,7 +87,7 @@ protected function get_general_tab( string $key ) : Field\Tab { ], 'search_keywords' => [ 'title' => 'Haun apusanat', - 'instructions' => 'Käytetään ennakoivassa haussa', + 'instructions' => 'Lisää tähän hakusanoja, joilla tämän koulutuksen halutaan löytyvän haussa', ], 'search_box_title' => [ 'title' => 'Hakulaatikon otsikko', diff --git a/lib/ACF/ProjectGroup.php b/lib/ACF/ProjectGroup.php index 7fb9ce9..b3952d1 100644 --- a/lib/ACF/ProjectGroup.php +++ b/lib/ACF/ProjectGroup.php @@ -113,7 +113,8 @@ protected function get_general_tab( string $key ) : Field\Tab { ->set_key( "{$key}_is_active" ) ->set_name( 'is_active' ) ->use_ui() - ->set_instructions( $strings['is_active']['instructions'] ); + ->set_instructions( $strings['is_active']['instructions'] ) + ->redipress_add_queryable( 'is_active' ); $title_lang_field = ( new Field\Select( $strings['title_lang']['title'] ) ) ->set_key( "{$key}_title_lang" ) diff --git a/models/page-project.php b/models/page-project.php index a8df70d..f5dd8ab 100644 --- a/models/page-project.php +++ b/models/page-project.php @@ -228,11 +228,13 @@ public function results() { $show_all_projects = self::get_show_all_projects_query_var(); // Show only active projects on default - if ( empty( $show_all_projects ) ) { + if ( $show_all_projects === false ) { $args['meta_query'] = [ - [ - 'key' => 'is_active', - 'value' => '1', + 'active_project_clause' => [ + [ + 'key' => 'is_active', + 'value' => '1', + ], ], ]; }