Removed unnecessary validation from general settings

This commit is contained in:
Alex Tselegidis 2021-12-20 09:15:05 +01:00
parent c40f2c7004
commit 37c46c7286

View file

@ -81,30 +81,6 @@ class General_settings extends EA_Controller {
$settings = request('general_settings', []); $settings = request('general_settings', []);
// Check if phone number settings are valid.
$phone_number_required = FALSE;
$phone_number_shown = FALSE;
foreach ($settings as $setting)
{
if ($setting['name'] === 'require_phone_number')
{
$phone_number_required = $setting['value'];
}
if ($setting['name'] === 'show_phone_number')
{
$phone_number_shown = $setting['value'];
}
}
if ($phone_number_required && ! $phone_number_shown)
{
throw new RuntimeException('You cannot hide the phone number in the booking form while it\'s also required!');
}
foreach ($settings as $setting) foreach ($settings as $setting)
{ {
$existing_setting = $this->settings_model->query()->where('name', $setting['name'])->get()->row_array(); $existing_setting = $this->settings_model->query()->where('name', $setting['name'])->get()->row_array();