Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin Page: Disable/hide setting when module is forced on/off #8800

Closed
ebinnion opened this issue Feb 9, 2018 · 1 comment
Closed

Admin Page: Disable/hide setting when module is forced on/off #8800

ebinnion opened this issue Feb 9, 2018 · 1 comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Type] Bug When a feature is broken and / or not performing as intended
Milestone

Comments

@ebinnion
Copy link
Contributor

ebinnion commented Feb 9, 2018

It is currently possible to force a module to be enabled, or disabled, via the jetpack_active_modules filter. Here's an example of using that filter to force the Photon module on:

add_filter( 'option_jetpack_active_modules', 'jetpack_docs_filter_active_modules' );
function jetpack_docs_filter_active_modules( $modules ) {
	return array_values( array_merge( $modules, array( 'photon' ) ) );
}

However, while that filter does force the module on, the UI is not aware that the Photon module is forced on. Because of this, I am able to deactivate Photon in the admin UI. But, when I refresh the page, the module is still active.

We should find some way to manage the UI when modules are forced on. It seems like we should either 1) disable the setting in the UI with a message that it is forced to active or 2) just hide the setting like we do when the module is filtered with the jetpack_get_available_modules filter.

@ebinnion ebinnion added [Type] Bug When a feature is broken and / or not performing as intended Admin Page React-powered dashboard under the Jetpack menu labels Feb 9, 2018
@ebinnion ebinnion added this to the 5.9 milestone Feb 9, 2018
@oskosk
Copy link
Contributor

oskosk commented Feb 12, 2018

Indeed, I encountered a similar problem when working on Admin Page: Hide Masterbar toggle for Atomic Sites. Ended up filtering by a custom check about Atomic sites, but there could be something better

matticbot pushed a commit that referenced this issue Feb 16, 2018
…se format to add override

Currently, it is possible to override the active modules in Jetpack and force some to be active or inactive. The issue with this is that our UI does not respond to that. So, while a module may be forced on, a user is shown UI that allows them to attempt to disable the module, except, when the page is refreshed, the module is still enabled.

See: #8836
See: #8800

Differential Revision: D10224-code

This commit syncs r170223-wpcom.
dereksmart pushed a commit that referenced this issue Feb 21, 2018
…se format to add override (#8863)

Currently, it is possible to override the active modules in Jetpack and force some to be active or inactive. The issue with this is that our UI does not respond to that. So, while a module may be forced on, a user is shown UI that allows them to attempt to disable the module, except, when the page is refreshed, the module is still enabled.

See: #8836
See: #8800

Differential Revision: D10224-code

This commit syncs r170223-wpcom.
@jeherve jeherve modified the milestones: 5.9, 6.0 Mar 7, 2018
@zinigor zinigor modified the milestones: 6.0, 6.1 Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants