Automattic / Automattic/babble

When a static front page is configured, the Appearance Menus Screen and search functionality are negatively impacted.

Open
#330 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
250
Forks
44
PR merge metrics
No merged PRs in 30d

Description

With a default twenty\* theme active, the Babble plugin enabled, languages configured, and translated content available, go to the Appearance Menus Screen and note that all content is available in the menu item meta boxes as expected.

Go to the front end of the site and perform a search. Note that the search functionality works as expected.

Now go to the Settings Reading Screen in Admin, and set a static front page.

After setting the static front page, return to the Appearance Menus Screen and note that not all content is available in the menu item meta boxes.

In fact, it appears that only the static front page is available to choose from in any post type menu item metabox. This implies that the front page is "taking over" the menu items available in the metaboxes on the Appearance Menus Screen.

Additionally, perform a new search from the front end of the site, and note that search no longer returns results, no matter the language, no matter the content searched for. This implies that the search query_var is dropped at some point, but only when a static front page has been configured.

Note the check for the page_on_front option at line 1069 of the Babble_Post_Public::translate_query_vars method on the develop branch.

```
if ( 'page' == get_option('show_on_front') && $page_on_front = get_option('page_on_front') ) {
```

It appears that this check is interfering with both the menu items metaboxes on the Appearance Menus Screen, and the search functionality, when a static front page has been set.

Changing that check to

```
if ( ! isset( $query_vars['s'] ) && 'page' == get_option( 'show_on_front' ) && $page_on_front = get_option( 'page_on_front' ) ) {
```

appears to resolve both the Appearance Menus Screen issues and search functionality issues.

In my testing, this did not appear to have a negative impact on any other expected functionality.

Contributor guide

Open the contributing guide

Research direction

Start at Babble_Post_Public::translate_query_vars around line 1069 and reproduce the issue with a static front page, checking both the Appearance Menus Screen and front-end search. The work is done when translated menu item metaboxes still expose all expected content and searches return results across languages with a static front page configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.