Skip to content

Commit a359428

Browse files
committed
Form & Translation Bug Fixed
1 parent 3932f0a commit a359428

File tree

7 files changed

+22
-21
lines changed

7 files changed

+22
-21
lines changed

.gitignore

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
###> PhpUnit ###
1+
###> symfony/phpunit-bridge ###
22
.phpunit
3+
.phpunit.result.cache
34
/phpunit.xml
4-
###< PhpUnit ###
5+
###< symfony/phpunit-bridge ###
56

67
###> Symfony ###
78
/.env.local
@@ -27,10 +28,4 @@ src/*/Entity/*/*~
2728
node_modules
2829
.idea
2930
/build/
30-
.DS_Store
31-
32-
###> symfony/phpunit-bridge ###
33-
.phpunit
34-
.phpunit.result.cache
35-
/phpunit.xml
36-
###< symfony/phpunit-bridge ###
31+
.DS_Store

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Controller/AccountController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ private function createUserFilterForm(): FormInterface
111111
->add('status', ChoiceType::class, [
112112
'label' => 'account_status',
113113
'choices' => [
114-
'select_all' => null,
115-
'deactive' => '0',
116-
'active' => '1',
114+
'deactive' => '1',
115+
'active' => '0',
117116
],
117+
'placeholder' => 'select_all',
118+
'required' => false
118119
])
119120
->getForm();
120121
}

src/Form/Config/ConfigAbstractType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function finishView(FormView $view, FormInterface $form, array $options)
6060
// Create File Type File Path
6161
foreach ($form->all() as $key => $formInterface) {
6262
if ('file' === $formInterface->getConfig()->getType()->getBlockPrefix()) {
63-
if (\is_array($formInterface->getViewData())) {
64-
$view->children[$key]->vars['file_path'] = $formInterface->getViewData();
63+
if ($formInterface->getViewData()) {
64+
$view->children[$key]->vars['file_path'] = !is_array($formInterface->getViewData()) ? [$formInterface->getViewData()] : $formInterface->getViewData();
6565
} elseif (!$formInterface->getViewData() && isset($options['data'][$key])) {
6666
$view->children[$key]->vars['file_path'] = $options['data'][$key];
6767
}

src/Form/Config/GeneralForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
158158
]),
159159
new Image([
160160
'mimeTypes' => [
161-
'image/x-icon', 'image/png',
161+
'image/x-icon', 'image/vnd.microsoft.icon', 'image/png',
162162
],
163163
]),
164164
],

src/Service/ConfigBag.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ public function saveToDB(ObjectManager $em, $configs): void
160160
// Update
161161
foreach ($data as $item) {
162162
if (\array_key_exists($item->getName(), $configs)) {
163-
$item->setValue($configs[$item->getName()]);
163+
if (is_bool($configs[$item->getName()])) {
164+
$item->setValue($configs[$item->getName()] ? 'true' : 'false');
165+
} else {
166+
$item->setValue($configs[$item->getName()]);
167+
}
164168
$em->persist($item);
165169

166170
unset($configs[$item->getName()]);

translations/messages.tr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ changes_saved: Değişiklikler kaydedildi.
131131
remove_complete: Silme işlemi tamamlandı.
132132
sorry_not_existing: Üzgünüz kayıt mevcut değil.
133133
test_email_success: Test e-postası gönderildi.
134+
user_registration_disable: Kullanıcı kaydı şu anda kapalı, lütfen daha sonra tekrar deneyin.
134135
440_not_found: Sayfa Bulunamadı!
135136
440_not_found_description: Üzgünüz aradığınız sayfa bulunamadı veya kullanımdan kaldırılmış olabilir.
136137

0 commit comments

Comments
 (0)