From 697992bb53c46e7f365a33e7a2fc271051f8e2ac Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 25 Apr 2024 15:45:50 +0200 Subject: [PATCH] mvc/model - implement getDescription() in NetworkAliasField. As this field type acts as a single (non-list) type, we need to return the description from here as well as BaseListField's implementation doesn't apply here. --- .../OPNsense/Base/FieldTypes/NetworkAliasField.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/NetworkAliasField.php b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/NetworkAliasField.php index 4ed589f7a..4e1b47285 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/NetworkAliasField.php +++ b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/NetworkAliasField.php @@ -103,6 +103,18 @@ class NetworkAliasField extends BaseListField throw new \Exception("Unsupported feature setMultiple()"); } + + /** + * {@inheritdoc} + */ + public function getDescription() + { + if (isset($this->internalOptionList[(string)$this])) { + return $this->internalOptionList[(string)$this]; + } + return (string)$this; + } + /** * retrieve field validators for this field type * @return array