Skip to content
Snippets Groups Projects
Commit 3010b780 authored by Andrey Vitushkin's avatar Andrey Vitushkin
Browse files

Issue #3450585: The wrong output in the "ipaddress_mysql" formatter if the...

Issue #3450585: The wrong output in the "ipaddress_mysql" formatter if the -None- option is selected in the formatter's settings
parent 0be4c16a
No related branches found
No related tags found
No related merge requests found
......@@ -92,11 +92,12 @@ final class IpAddressMySqlFormatter extends FormatterBase {
*/
protected function viewValue($ipAddress, $networkMask) {
// If a user has not selected any functions in the formatter settings, then
// return the IP address in the CIDR notation, like "192.168.100.10/24".
// return the IP address in the CIDR notation, like "192.168.100.1/24".
if ($this->getSetting('function') === '') {
$prefixLength = Network::parse("$ipAddress $networkMask")->getPrefixLength();
return [
'#theme' => 'field__ipaddress_pgsql',
'#value' => Network::parse("$ipAddress $networkMask")->getCIDR(),
'#value' => "$ipAddress/$prefixLength",
];
}
......
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