Skip to content
Snippets Groups Projects
Commit d1d2178f authored by uhensler's avatar uhensler
Browse files

OO-2699: validate only if it was configured once

parent b76f6536
No related branches found
No related tags found
No related merge requests found
......@@ -79,8 +79,8 @@ public class Card2BrainConfigController extends FormBasicController {
setFormTitle("edit.title");
setFormContextHelp("KnowledgeTransfer#_card2brain");
String falshcardAlias = config.getStringValue(Card2BrainCourseNode.CONFIG_FLASHCARD_ALIAS);
flashcardAliasEl = uifactory.addTextElement("edit.flashcard.alias", "edit.flashcard.alias", 128, falshcardAlias,
String flashcardAlias = config.getStringValue(Card2BrainCourseNode.CONFIG_FLASHCARD_ALIAS);
flashcardAliasEl = uifactory.addTextElement("edit.flashcard.alias", "edit.flashcard.alias", 128, flashcardAlias,
formLayout);
flashcardAliasEl.setMandatory(true);
flashcardAliasEl.setHelpTextKey("edit.FlashcardHelpText", null);
......@@ -114,7 +114,15 @@ public class Card2BrainConfigController extends FormBasicController {
uifactory.addFormSubmitButton("save", formLayout);
showHidePrivateLoginFields();
validateFormLogic(ureq);
validateLogin();
if (StringHelper.containsNonWhitespace(flashcardAlias)) {
// Validate at init e.g. if the flashcards still exists.
validateFormLogic(ureq);
} else {
// Don't show the preview button after insert of an new course element
showHidePreviewButton(false);
}
}
/**
......
......@@ -14,7 +14,7 @@ edit.warning.bothLoginDisabled=Both login methods are disabled. Please contact y
edit.warning.bothLoginDisabled.short=Both login methods are disabled.
edit.warning.enterpriseLoginDisabled=That set of flashcard was configured with a enterprise login. The enterprise login was disabled by the administrator in the meantime.
edit.warning.enterpriseLoginDisabled.short=The enterprise login is disabled.
edit.warning.privateLoginDisabled=That set of flashcard was configured with a private login. The private login was disabled by the administrator in the meantime. Save the configuration again to take the enterprise login.
edit.warning.privateLoginDisabled=That set of flashcard was configured with a private login. The private login was disabled by the administrator in the meantime. Save the configuration again to use the enterprise login.
edit.warning.privateLoginDisabled.short=The private login is disabled.
link.text=card2brain flashcards
pane.tab.accessibility=Access
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment