From bede5142618b0e53900a43b9afbeb80268b17985 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 4 Feb 2019 15:25:15 -0500
Subject: [PATCH] Eliminate VuFind\Export::getBulkOptions(). - Deprecated since
 release 3.0.

---
 module/VuFind/src/VuFind/Export.php           | 12 ----------
 .../unit-tests/src/VuFindTest/ExportTest.php  | 23 ++-----------------
 .../search/bulk-action-buttons.phtml          |  2 +-
 3 files changed, 3 insertions(+), 34 deletions(-)

diff --git a/module/VuFind/src/VuFind/Export.php b/module/VuFind/src/VuFind/Export.php
index 27966018627..bd95bfa6de1 100644
--- a/module/VuFind/src/VuFind/Export.php
+++ b/module/VuFind/src/VuFind/Export.php
@@ -74,18 +74,6 @@ class Export
         $this->exportConfig = $exportConfig;
     }
 
-    /**
-     * Get bulk export options.
-     *
-     * @deprecated use getActiveFormats($context) instead
-     *
-     * @return array
-     */
-    public function getBulkOptions()
-    {
-        return $this->getActiveFormats('bulk');
-    }
-
     /**
      * Get the URL for bulk export.
      *
diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ExportTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ExportTest.php
index e3f57eea0bd..a4e598765fa 100644
--- a/module/VuFind/tests/unit-tests/src/VuFindTest/ExportTest.php
+++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ExportTest.php
@@ -42,7 +42,7 @@ use Zend\Config\Config;
 class ExportTest extends \PHPUnit\Framework\TestCase
 {
     /**
-     * Test bulk options using legacy (deprecated) configuration.
+     * Test options using legacy (deprecated) configuration.
      *
      * @return void
      */
@@ -61,26 +61,7 @@ class ExportTest extends \PHPUnit\Framework\TestCase
             ],
         ];
         $export = $this->getExport($config);
-        $this->assertEquals(['foo', 'bar'], $export->getBulkOptions());
-    }
-
-    /**
-     * Test bulk options.
-     *
-     * @return void
-     */
-    public function testGetBulkOptions()
-    {
-        $config = [
-            'Export' => [
-                'foo' => 'record,bulk',
-                'bar' => 'record,bulk',
-                'baz' => 0,
-                'xyzzy' => 'record',
-            ],
-        ];
-        $export = $this->getExport($config);
-        $this->assertEquals(['foo', 'bar'], $export->getBulkOptions());
+        $this->assertEquals(['foo', 'bar'], $export->getActiveFormats('bulk'));
     }
 
     /**
diff --git a/themes/bootstrap3/templates/search/bulk-action-buttons.phtml b/themes/bootstrap3/templates/search/bulk-action-buttons.phtml
index 5955b7d2782..f9163d35583 100644
--- a/themes/bootstrap3/templates/search/bulk-action-buttons.phtml
+++ b/themes/bootstrap3/templates/search/bulk-action-buttons.phtml
@@ -10,7 +10,7 @@
     <div class="btn-group">
       <?php if (isset($this->showBulkOptions) && $this->showBulkOptions): ?>
         <input id="ribbon-email" class="btn btn-default" type="submit" name="email" title="<?=$this->transEsc('bookbag_email_selected')?>" value="<?=$this->transEsc('Email')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/>
-        <?php $exportOptions = $this->export()->getBulkOptions(); if (count($exportOptions) > 0): ?>
+        <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?>
           <input id="ribbon-export" class="btn btn-default" type="submit" name="export" title="<?=$this->transEsc('bookbag_export_selected')?>" value="<?=$this->transEsc('Export')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/>
         <?php endif; ?>
         <input id="ribbon-print" class="btn btn-default" type="submit" name="print" title="<?=$this->transEsc('bookbag_print_selected')?>" value="<?=$this->transEsc('Print')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/>
-- 
GitLab