Skip to content

Commit

Permalink
Merge pull request #26 from germanbisurgi/master
Browse files Browse the repository at this point in the history
languages array to lowercase
  • Loading branch information
handcode committed Dec 12, 2017
2 parents 484efcd + 4b3dc5c commit aa21ad3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/forms/CopyForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function validateSourceRootExists($attribute)
public function validateDestinationLanguage($attribute)
{
// build available languages
$availableLanguages = ArrayHelper::merge([Tree::GLOBAL_ACCESS_DOMAIN], \Yii::$app->urlManager->languages);
$availableLanguages = ArrayHelper::merge([Tree::GLOBAL_ACCESS_DOMAIN], array_map('strtolower', \Yii::$app->urlManager->languages));

if (!in_array($this->$attribute, $availableLanguages, true)) {
$this->addError($attribute, \Yii::t('pages', 'Target Language "{language}" node does not exist', ['language' => $this->$attribute]));
Expand Down

0 comments on commit aa21ad3

Please sign in to comment.