[freeside-commits] branch FREESIDE_3_BRANCH updated. 2ec92076c7dae5648da28e510efa1f733da9fd76

Ivan ivan at 420.am
Fri May 13 17:28:15 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  2ec92076c7dae5648da28e510efa1f733da9fd76 (commit)
       via  ec443f3ab9fd937325691b17974ea5aa7dce264d (commit)
      from  039d72ae9e7adf98f46c3b4219100d57208c3685 (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 2ec92076c7dae5648da28e510efa1f733da9fd76
Merge: ec443f3 039d72a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri May 13 17:28:09 2016 -0700

    Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH


commit ec443f3ab9fd937325691b17974ea5aa7dce264d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri May 13 17:27:59 2016 -0700

    fix part_pkg-bulk_change when not using -o / -v, RT#41733

diff --git a/bin/part_pkg-bulk_change b/bin/part_pkg-bulk_change
index 32a5129..c882954 100755
--- a/bin/part_pkg-bulk_change
+++ b/bin/part_pkg-bulk_change
@@ -20,22 +20,28 @@ $search{'comment'} = $opt_m if $opt_m;
 foreach my $part_pkg ( qsearch('part_pkg',\%search) ) {
   next if ! $part_pkg->freq && $opt_r;
 
-  my %hash = (
-    'pkgpart'    => $part_pkg->pkgpart,
-    'optionname' => $opt_o,
-  );
-
-  my $part_pkg_option = qsearchs('part_pkg_option', \%hash);
-
-  if ( $part_pkg_option ) {
-    next if $part_pkg_option->optionvalue eq $opt_v;
-    $part_pkg_option->optionvalue($opt_v);
-    my $error = $part_pkg_option->replace;
-    die $error if $error;
-  } else {
-    $part_pkg_option = new FS::part_pkg_option { %hash, 'optionvalue'=>$opt_v };
-    my $error = $part_pkg_option->insert;
-    die $error if $error;
+  if ( $opt_o ) {
+
+    my %hash = (
+      'pkgpart'    => $part_pkg->pkgpart,
+      'optionname' => $opt_o,
+    );
+
+    my $part_pkg_option = qsearchs('part_pkg_option', \%hash);
+
+    if ( $part_pkg_option ) {
+      next if $part_pkg_option->optionvalue eq $opt_v;
+      $part_pkg_option->optionvalue($opt_v);
+      my $error = $part_pkg_option->replace;
+      die $error if $error;
+    } else {
+      $part_pkg_option = new FS::part_pkg_option { %hash,
+                                                   'optionvalue'=>$opt_v,
+                                                 };
+      my $error = $part_pkg_option->insert;
+      die $error if $error;
+    }
+
   }
 
   if ( $opt_t || $opt_s || $opt_S || $opt_z || $opt_Z ) {

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

Summary of changes:
 bin/part_pkg-bulk_change |   38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)




More information about the freeside-commits mailing list