Skip to content

Commit

Permalink
TMS-1075-fix: Program page query fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eebbi committed Oct 29, 2024
1 parent 94b7fb1 commit 305c416
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/ACF/ProgramGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion lib/ACF/ProjectGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down
10 changes: 6 additions & 4 deletions models/page-project.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
],
];
}
Expand Down

0 comments on commit 305c416

Please sign in to comment.