[freeside-commits] branch FREESIDE_4_BRANCH updated. 3c32a627231b397f95f3e464ddf93e9f58aa9ab0

Ivan ivan at 420.am
Wed Dec 9 16:56:07 PST 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  3c32a627231b397f95f3e464ddf93e9f58aa9ab0 (commit)
      from  60038d862886d0eb3e9ac7fda516786d3a1c3388 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3c32a627231b397f95f3e464ddf93e9f58aa9ab0
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 9 16:56:05 2015 -0800

    deal when Net::MAC::Vendor-lookup doesn't return an arrayref, RT#39384

diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html
index d7a1dcf..296c27b 100644
--- a/httemplate/view/elements/svc_Common.html
+++ b/httemplate/view/elements/svc_Common.html
@@ -283,8 +283,8 @@ my $format_field = sub {
   } elsif ( $type eq 'checkbox' ) {
     $value = $value eq 'Y' ? emt('Yes') : emt('No');
   } elsif ( $type =~ /(input-)?mac_addr/ and $value =~ /\w/) {
-    my $vendor = Net::MAC::Vendor::lookup($value)->[0];
-    $value .= " ($vendor)" if $vendor;
+    my $vendor = Net::MAC::Vendor::lookup($value);
+    $value .= ' ('. $vendor->[0]. ')' if $vendor;
     $value = $m->scomp('/elements/mac_addr.html', $value);
   }
 
diff --git a/httemplate/view/elements/svc_devices.html b/httemplate/view/elements/svc_devices.html
index 899e6aa..3d4e1bb 100644
--- a/httemplate/view/elements/svc_devices.html
+++ b/httemplate/view/elements/svc_devices.html
@@ -63,7 +63,8 @@
             <% $td %><% $device->part_device->devicename |h %></TD>
 %         }
           <% $td %><% $device->mac_addr_pretty %>
-                 (<% (Net::MAC::Vendor::lookup($device->mac_addr_formatted('U',':')))->[0] %>)
+%                my $vendor = Net::MAC::Vendor::lookup($device->mac_addr_formatted('U',':'));
+                 (<% $vendor ? $vendor->[0] : '' %>)
           </TD>
           <% $td %><% $export_links %></TD>
           <% $td %>(
diff --git a/httemplate/view/elements/svc_radius_usage.html b/httemplate/view/elements/svc_radius_usage.html
index 4719691..5619852 100644
--- a/httemplate/view/elements/svc_radius_usage.html
+++ b/httemplate/view/elements/svc_radius_usage.html
@@ -27,8 +27,11 @@
 %  ) / 1073741824;
 %
 %  my $last_mac = $svc->attribute_last_sqlradacct( 'CallingStationId' );
-%  if ( $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
-%    $last_mac .= ' ('. (Net::MAC::Vendor::lookup($1))->[0]. ')';
+%  if (    $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i
+%       && my $vendor = Net::MAC::Vendor::lookup($1)
+%     )
+%  {
+%    $last_mac .= ' ('. $vendor->[0]. ')';
 %  }
 
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/elements/svc_Common.html       |    4 ++--
 httemplate/view/elements/svc_devices.html      |    3 ++-
 httemplate/view/elements/svc_radius_usage.html |    7 +++++--
 3 files changed, 9 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list