|
3 | 3 | namespace Formwork\Panel\Controllers; |
4 | 4 |
|
5 | 5 | use Formwork\Config\Config; |
6 | | -use Formwork\Http\RequestMethod; |
7 | 6 | use Formwork\Http\Response; |
8 | 7 | use Formwork\Parsers\Yaml; |
9 | 8 | use Formwork\Schemes\Schemes; |
@@ -44,11 +43,7 @@ public function systemOptions(Schemes $schemes): Response |
44 | 43 | $scheme = $schemes->get('config.system'); |
45 | 44 | $fields = $scheme->fields(); |
46 | 45 |
|
47 | | - // Set initial values on GET |
48 | | - if ($this->request->method() === RequestMethod::GET) { |
49 | | - $fields->setValues($this->config->get('system')) |
50 | | - ->isValid(); // Pre-validate to populate validation state |
51 | | - } |
| 46 | + $fields->setValues($this->config->get('system')); |
52 | 47 |
|
53 | 48 | $form = $this->form('system-options', $fields) |
54 | 49 | ->processRequest($this->request); |
@@ -97,11 +92,7 @@ public function siteOptions(Schemes $schemes): Response |
97 | 92 | $scheme = $schemes->get('config.site'); |
98 | 93 | $fields = $scheme->fields(); |
99 | 94 |
|
100 | | - // Set initial values on GET |
101 | | - if ($this->request->method() === RequestMethod::GET) { |
102 | | - $fields->setValues($this->site->data()) |
103 | | - ->isValid(); // Pre-validate to populate validation state |
104 | | - } |
| 95 | + $fields->setValues($this->site->data()); |
105 | 96 |
|
106 | 97 | $form = $this->form('site-options', $fields) |
107 | 98 | ->processRequest($this->request); |
|
0 commit comments