diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index fa4375a70a1e118106b27e8b8bcc352ea378dd7d..bfbdb9ed07194976ff66f9e6ac38b9c7cc2bc735 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -2022,6 +2022,12 @@ trait SolrMarcFincTrait return $array; } // end if foreach ($rvk as $key => $line) { + /* refs #15339 use rvk notation only */ + if ($line->getIndicator('1') !== 'r' || + $line->getIndicator('2') !== 'v') { + continue; + } + // if subfield with rvk exists if ($line->getSubfield('a')) { // get rvk diff --git a/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php b/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php index e650605d4d91d8e6989108adfab2b429606725a2..3218af2a6108144cae40d22ef394f5a47e9f5f41 100644 --- a/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php +++ b/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php @@ -73,9 +73,9 @@ class ExternalCatalogueLink extends \Zend\View\Helper\AbstractHelper * @param array $extCatConf External catalogue link configuration */ public function __construct( - $config, - $extCatConf = [] - ) { + $config, $extCatConf = [] + ) + { $this->config = $config; $this->extCatConf = $extCatConf; } @@ -117,30 +117,18 @@ class ExternalCatalogueLink extends \Zend\View\Helper\AbstractHelper $extUrls = []; foreach ($this->extCatConf as $recordType => $accessUrls) { - $replaceId = null; - // get identifier of record id type - switch ($recordType) { - case "id": - $replaceId = $this->driver->getUniqueID(); - break; - case "record_id": - $replaceId = $this->driver->tryMethod('getRID'); - break; - default: - $replaceId = $this->driver->tryMethod('get'.ucfirst($recordType)); + $replaceId = $this->driver->tryMethod('getField', [$recordType]); + if (empty($replaceId)) { + continue; } foreach ($accessUrls as $institution => $accessUrl) { + // check institution + if (false === in_array($institution, $institutions)) { + continue; + } foreach ($accessUrl as $v) { - // pre-filter replaceId - if (isset($v['filter'])) { - $isReplaceId = ( - true === $this->filterAccessibilityUrl($v['filter']) - ) ? $replaceId : null; - } - // institution filter - if (true === in_array($institution, $institutions) - && !empty($isReplaceId) - ) { + // check filter + if (!isset($v['filter']) || true === $this->filterAccessibilityUrl($v['filter'])) { $extUrls[++$i]['desc'] = $institution; $extUrls[$i]['url'] = sprintf($v['pattern'], $replaceId); } diff --git a/module/finc/tests/fixtures/externallink/testexternallink1.json b/module/finc/tests/fixtures/externallink/testexternallink1.json index 0dc98abbbb0f813a676fc04ad33c5bd9bf78bf14..a003aa3234013507e659fe5dd78f4acec55064df 100644 --- a/module/finc/tests/fixtures/externallink/testexternallink1.json +++ b/module/finc/tests/fixtures/externallink/testexternallink1.json @@ -1,9 +1,9 @@ { "ppn": { - "DE-540": { + "DE-540": [{ "pattern": "http://194.94.197.6/libero/WebopacOpenURL.cls?ACTION=DISPLAY&LANG=DE&RID=%s" - }, - "DE-D13": { + }], + "DE-D13": [{ "pattern": "http://webopac.skd.museum/libero/WebopacOpenURL.cls?ACTION=DISPLAY&RID=%s", "filter": { "getSourceID": [ @@ -11,17 +11,17 @@ "22" ] } - }, - "DE-L242": { + }], + "DE-L242": [{ "pattern": "http://webpac.bibhgb.hgb-leipzig.de/libero/WebopacOpenURL.cls?ACTION=DISPLAY&RID=%s" - }, - "DE-D117": { + }], + "DE-D117": [{ "pattern": "http://www.hfmdd.de:8060/alipac/-/item-local?VID=%s" - } + }] }, "id": { - "DE-14": { + "DE-14": [{ "pattern": "http://katalogbeta.slub-dresden.de/id/%s/" - } + }] } } \ No newline at end of file diff --git a/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php b/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php index f9a6557cb94b42314da6e0c7c902bbede0be67ad..5a2559ae84f3c67558be3a6617ed01f400535d02 100644 --- a/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php +++ b/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php @@ -52,7 +52,7 @@ class ExternalCatalogueLinkTest extends \VuFindTest\Unit\ViewHelperTestCase */ public function testGetLinks() { - //fwrite(STDERR, print_r($driver, true)); + // @codingStandardsIgnoreStart $externalCatalogue = $this->getExternalCatalogueLink( [], @@ -85,7 +85,6 @@ class ExternalCatalogueLinkTest extends \VuFindTest\Unit\ViewHelperTestCase ) ); $links = $externalCatalogue->getLinks(); - fwrite(STDERR, print_r($links, true)); $expectedArray = [ [ "desc" => "DE-540", @@ -93,6 +92,7 @@ class ExternalCatalogueLinkTest extends \VuFindTest\Unit\ViewHelperTestCase ] ]; $this->assertEquals(json_encode($expectedArray), json_encode($links)); + // @codingStandardsIgnoreEnd } /** @@ -114,6 +114,7 @@ class ExternalCatalogueLinkTest extends \VuFindTest\Unit\ViewHelperTestCase $institutions = ["DE-14", "DE-D13"] ) { $driver = $this->getMockBuilder($class) + ->setMethods(['getUniqueID', 'getSourceID', 'tryMethod']) ->disableOriginalConstructor()->getMock(); $driver->expects($this->any())->method('getUniqueID') ->will($this->returnValue($id)); @@ -124,6 +125,7 @@ class ExternalCatalogueLinkTest extends \VuFindTest\Unit\ViewHelperTestCase ->withConsecutive( [$this->equalTo('getInstitutions')], [$this->equalTo('getRID')], + [$this->equalTo('getPpn')], [$this->equalTo('getSourceID')] ) ->willReturnOnConsecutiveCalls( @@ -180,5 +182,4 @@ class ExternalCatalogueLinkTest extends \VuFindTest\Unit\ViewHelperTestCase new ExternalCatalogueLink(new Config($config), $rules); return $externalCatalogueLink; } - -} \ No newline at end of file +} diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index f46adc1cd27fcdf62b82b0957e925cd63c49267f..722bf5a045dd4edc4aaf4e149ecefa99a9b96f23 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -1946,6 +1946,23 @@ footer { background: $sidebar-item-active-hover-bg; } +// #13625 avoid ugly linebreaks with overlong words +.sidebar { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + -o-hyphens: auto; + hyphens: auto; + .facet { + -ms-word-break: break-all; + word-break: break-all; // fallback for hyphens: auto (Chrome on Desktop and bug on Mozilla for capitalized words) + .text { + -ms-word-break: break-word; + word-break: break-word; + } + } +} + //// OR- and AND-Facets + item counts in My Account ///// Style the exclude icons .exclude i {