Skip to content
Snippets Groups Projects
Commit 1c7ee7cb authored by Tomotaka Hosomi's avatar Tomotaka Hosomi Committed by Yas Naoi
Browse files

Issue #3353175 by hosomitm, Ryo Yamashita, yas: Fix the broken CIDR field on...

Issue #3353175 by hosomitm, Ryo Yamashita, yas: Fix the broken CIDR field on the OpenStack Port Edit form in SPA
parent 55563861
No related branches found
No related tags found
No related merge requests found
......@@ -88,8 +88,8 @@ const OPENSTACK_PORT_TEMPLATE: EntityFormTemplate[] = [
defaultValue: [],
},
{ type: 'item-array', labelName: 'Allowed Address Pairs', name: 'allowed_address_pairs', defaultValue: [], info: [
{ labelName: 'IP address or CIDR', name: 'item_key' },
{ labelName: 'MAC address', name: 'item_value' },
{ labelName: 'IP address or CIDR', name: 'item_key', type: 'default' },
{ labelName: 'MAC address', name: 'item_value', type: 'default' },
] },
]
}
......
......@@ -1082,7 +1082,7 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
$entity->setPortSecurityEnabled($request->get('port_security_enabled', '') === 'true');
$allowed_address_pairs = json_decode($request->get('allowed_address_pairs', '[]'), TRUE);
foreach ($allowed_address_pairs ?: [] as $idx => $value) {
if (empty($value->item_key)) {
if (empty($value['item_key'])) {
unset($allowed_address_pairs[$idx]);
}
}
......
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