Remove @Todo In ConfigDistroImportForm's buildForm method.

Created on 25 June 2024, 6 months ago

Problem/Motivation

While reading the code for ConfigDistroImportForm, I noticed a @todo in the buildForm method that asks:
// @todo why is this empty?

Proposed resolution

Answer why...

The reason $form_state->get('storage_comparer') is empty, is the parent class doesn't always add the storage comparer.

Early Return Conditions:
If empty($source_list) or !$storage_comparer->hasChanges(), the form is returned early, and the storage_comparer is not set in the form state.
If !$storage_comparer->validateSiteUuid(), the form is returned early, and the storage_comparer is not set in the form state.

See https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/confi...

Updating the parent class by moving Line 173 to Line 125 fixed the issue for me.

πŸ“Œ Task
Status

Postponed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024