Page MenuHomePhabricator

CommunityConfiguration has a hack to truly disable fields via onCommunityConfigurationSchemaBeforeEditor
Open, MediumPublic

Description

While working on T407818: Add a Link: Rollout "Add a Link" Structured Task to Chinese, Japanese, & Urdu Wikipedias, I noticed the following lines of code in GrowthExperiments:includes/Config/CommunityConfigurationHooks.php:

public function onCommunityConfigurationSchemaBeforeEditor(
	IConfigurationProvider $provider, array &$rootSchema
) {
	switch ( $provider->getId() ) {
		// [...]
		case 'GrowthSuggestedEdits':
			if ( !$this->config->get( 'GELinkRecommendationsFrontendEnabled' ) ) {
				// HACK: for T370611. This should be removed asap, ideally before end of August 2024.
				$rootSchema['properties']['link_recommendation']['properties']['disabled']['disabled-true-hack-T370611'] = true;
			}
		break;
		// [...]
	}
}

Equivalent hack is present in CommunityConfiguration:resources/ext.communityConfiguration.Editor/lib/json-form/controls-codex/src/controls/BooleanControl.vue.

Because of the Tim Starling's law, this solution outlived the time annotation it has in the comment (to remove before the end of August 2024). Given that was well over a year ago, I'm filling this task to decide about the future of this hack.

Originally, it was introduced because of T370611: CommunityConfiguration: `Add a link (Structured task)` fix handling when "backend" is enabled & "frontend" is disabled, where we needed to disable a checkbox, but keep it visible in the wikipage. Unfortunately, we would need UI schemas (T370534) for this to be easily possible, which we still do not have. I'm not sure if the original plan was to implement UI schemas prior to August 2024, or to eventually settle for some other solution.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Urbanecm_WMF added a subscriber: Sgs.

@Sgs, maybe you remember more of this issue?

Michael triaged this task as High priority.Tue, Jan 20, 1:37 PM