From db642b8ae5459a9c2e535ac00ad5350a8c40aa40 Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@afi-sa.fr> Date: Fri, 27 Feb 2015 09:16:04 +0100 Subject: [PATCH] rd #14085 pnb regression fix --- library/ZendAfi/Form/Element/UsageConstraints.php | 2 +- library/ZendAfi/View/Helper/Album/UsageConstraints.php | 3 ++- library/storm | 2 +- tests/library/Class/AlbumTest.php | 6 ++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/library/ZendAfi/Form/Element/UsageConstraints.php b/library/ZendAfi/Form/Element/UsageConstraints.php index a5811fb1556..13aa231eeb5 100644 --- a/library/ZendAfi/Form/Element/UsageConstraints.php +++ b/library/ZendAfi/Form/Element/UsageConstraints.php @@ -22,7 +22,7 @@ class ZendAfi_Form_Element_UsageConstraints extends Zend_Form_Element_Xhtml { public function __construct($spec, $options = null) { parent::__construct($spec, $options); $decorators = $this->_decorators; - $this->_decorators = ['Ckeditor' => new ZendAfi_Form_Decorator_UsageConstraints()]; + $this->_decorators = ['UsageConstraints' => new ZendAfi_Form_Decorator_UsageConstraints()]; foreach ($decorators as $name => $value) { $this->_decorators[$name] = $value; diff --git a/library/ZendAfi/View/Helper/Album/UsageConstraints.php b/library/ZendAfi/View/Helper/Album/UsageConstraints.php index 45e0ee7bc52..eaa8c662a0d 100644 --- a/library/ZendAfi/View/Helper/Album/UsageConstraints.php +++ b/library/ZendAfi/View/Helper/Album/UsageConstraints.php @@ -26,8 +26,9 @@ class ZendAfi_View_Helper_Album_UsageConstraints extends Zend_View_Helper_HtmlEl $_content; public function album_UsageConstraints($constraints){ - $constraints->acceptVisitor($this); + if (!$constraints) return ''; + $constraints->acceptVisitor($this); return '<dl>'.$this->_content.'</dl>'; } diff --git a/library/storm b/library/storm index c338305ef8b..0d29c04630a 160000 --- a/library/storm +++ b/library/storm @@ -1 +1 @@ -Subproject commit c338305ef8b9b31962a035e2e78847333cb8908c +Subproject commit 0d29c04630a16542783f90d8f43a55d738abe586 diff --git a/tests/library/Class/AlbumTest.php b/tests/library/Class/AlbumTest.php index 77a57aca988..b181c89fbb6 100644 --- a/tests/library/Class/AlbumTest.php +++ b/tests/library/Class/AlbumTest.php @@ -77,6 +77,12 @@ class AlbumHarlockBasicTest extends AlbumHarlockTestCase { } + /** @test */ + public function usageConstraintsShouldBeEmptyArray() { + $this->assertEquals(0, count($this->_album->getUsageConstraints())); + } + + /** @test */ public function permalinkShouldBeBibNumNotice999() { $this->assertEquals(array('module' => 'opac', -- GitLab