Fix checks for form mode in LanguageAddForm
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 26 Apr 2023 10:07:28 +0000 (12:07 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 26 Apr 2023 10:07:28 +0000 (12:07 +0200)
wcfsetup/install/files/lib/acp/form/LanguageAddForm.class.php

index bf03b27e871b3a6958ff3a3c50e0f4e7830484f1..424044bb272af27cf860cb1efa2d602ca3122241 100644 (file)
@@ -157,7 +157,7 @@ class LanguageAddForm extends AbstractFormBuilderForm
                         ->label('wcf.acp.language.add.source')
                         ->description('wcf.acp.language.add.source.description')
                         ->options(LanguageFactory::getInstance()->getLanguages())
-                        ->available($this->formAction === IFormDocument::FORM_MODE_CREATE)
+                        ->available($this->form->getFormMode() === IFormDocument::FORM_MODE_CREATE)
                         ->required(),
                 ]),
         ]);
@@ -182,7 +182,7 @@ class LanguageAddForm extends AbstractFormBuilderForm
         $this->form->getDataHandler()->addProcessor(new CustomFormDataProcessor(
             'sourceLanguage',
             function (IFormDocument $document, array $parameters) {
-                if ($this->formAction !== IFormDocument::FORM_MODE_CREATE) {
+                if ($document->getFormMode() !== IFormDocument::FORM_MODE_CREATE) {
                     return $parameters;
                 }