Skip to content

Commit d9d0f45

Browse files
Safwan Khaneddielau
Safwan Khan
authored andcommitted
MAGETWO-32026: [GitHub] Invalid backend frontname During Installation #823
- Changes based on CR feedback.
1 parent 852f4aa commit d9d0f45

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfig/BackendConfigTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,20 @@ public function testGetData()
2323
* @expectedException \InvalidArgumentException
2424
* @expectedExceptionMessage No backend frontname provided.
2525
*/
26-
public function testEmptyData()
26+
public function testUnsetData()
2727
{
2828
new BackendConfig([]);
2929
}
3030

31+
/**
32+
* @expectedException \InvalidArgumentException
33+
* @expectedExceptionMessage Empty backend frontname provided.
34+
*/
35+
public function testEmptyData()
36+
{
37+
new BackendConfig(['frontName' => '']);
38+
}
39+
3140
/**
3241
* @param array $data
3342
* @dataProvider invalidDataDataProvider

lib/internal/Magento/Framework/App/DeploymentConfig/BackendConfig.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public function __construct(array $data)
2828
if (!isset($data[self::KEY_FRONTNAME])) {
2929
throw new \InvalidArgumentException("No backend frontname provided.");
3030
}
31+
if ($data[self::KEY_FRONTNAME] === '') {
32+
throw new \InvalidArgumentException("Empty backend frontname provided.");
33+
}
3134
if (!preg_match('/^[a-zA-Z0-9_]+$/', $data[self::KEY_FRONTNAME])) {
3235
throw new \InvalidArgumentException("Invalid backend frontname {$data[self::KEY_FRONTNAME]}");
3336
}

setup/pub/magento/setup/landing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ angular.module('landing', ['ngStorage'])
99
'$location',
1010
'$localStorage',
1111
function ($scope, $location, $localStorage) {
12+
$localStorage.$reset();
1213
$scope.selectLanguage = function () {
1314
$localStorage.lang = $scope.modelLanguage;
1415
window.location = 'index.php/' + $scope.modelLanguage + '/index';

setup/pub/magento/setup/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
'use strict';
66
var main = angular.module('main', ['ngStorage']);
7-
main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navigationService', '$localStorage', function ($scope, $state, $rootScope, navigationService, $localStorage) {
7+
main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navigationService', function ($scope, $state, $rootScope, navigationService) {
88
navigationService.load();
99
$rootScope.isMenuEnabled = true;
1010
$scope.itemStatus = function (order) {

0 commit comments

Comments
 (0)