Skip to content
Snippets Groups Projects
Commit 2fe61b2c authored by Davyd Burianuvatyi's avatar Davyd Burianuvatyi
Browse files

Issue #3347785: Fixed fatal error with form setting

parent ce8ae943
Branches
Tags
1 merge request!1Issue #3347785: The website encounter an unexpected error
......@@ -99,7 +99,7 @@ class SettingsForm extends ConfigFormBase {
/* @see \Drupal\openy_programs_search\DataStorage::getExcludeLocationMapIds */
$exclude_location_map = $config->get('exclude_location_map');
$num_exclude_location_map = $form_state->get('num_exclude_location_map');
if (empty($num_exclude_location_map)) {
if (empty($num_exclude_location_map) && $exclude_location_map) {
if (count($exclude_location_map) < 1) {
$num_exclude_location_map = 1;
$exclude_location_map = [];
......@@ -152,7 +152,7 @@ class SettingsForm extends ConfigFormBase {
// Location name string replace for Daxko Location Map.
$name_string_replace_location_map = $config->get('name_string_replace_location_map');
$num_name_string_replace_location_map = $form_state->get('num_name_string_replace_location_map');
if (empty($num_name_string_replace_location_map)) {
if (empty($num_name_string_replace_location_map) && $name_string_replace_location_map) {
if (count($name_string_replace_location_map) < 1) {
$num_name_string_replace_location_map = 1;
$name_string_replace_location_map = [];
......@@ -209,7 +209,7 @@ class SettingsForm extends ConfigFormBase {
/* @see \Drupal\openy_programs_search\DataStorage::getLocationsByChildCareProgramId */
$pinned_programs = $config->get('pinned_programs');
$num_pinned_programs = $form_state->get('num_pinned_programs');
if (empty($num_pinned_programs)) {
if (empty($num_pinned_programs) && $pinned_programs) {
if (count($pinned_programs) < 1) {
$num_pinned_programs = 1;
$pinned_programs = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment