diff --git a/library/Class/Notice/Xsl.php b/library/Class/Notice/Xsl.php index 4d490e315819a4c4d6233a972f6f0ddb109ba017..d2f93527c3e72cfcc921ddc9529c4ddacc763d95 100644 --- a/library/Class/Notice/Xsl.php +++ b/library/Class/Notice/Xsl.php @@ -73,6 +73,11 @@ class Class_Notice_Xsl { } + public function unlink($filename) { + static::getPhpCommand()->unlink($filename); + } + + protected function _getXslFileFromProfile() { $settings = $this->_profile->getCfgModulesPreferences('recherche', 'viewnotice', $this->_record->getTypeDoc()); if(!$settings) diff --git a/library/ZendAfi/View/Helper/Notice/Xsl.php b/library/ZendAfi/View/Helper/Notice/Xsl.php index 23d6f00483be1f6c49516e83c45e8fe1d0c56544..ba8e02b245544c48b3ade723a575c1f399d7d64c 100644 --- a/library/ZendAfi/View/Helper/Notice/Xsl.php +++ b/library/ZendAfi/View/Helper/Notice/Xsl.php @@ -46,6 +46,8 @@ class ZendAfi_View_Helper_Notice_Xsl extends ZendAfi_View_Helper_BaseHelper { $this->_('xsl'), ['target' => 'blank'])), ['class' => 'error']); + + $xsl->unlink($marc_xml); return $response; } } \ No newline at end of file diff --git a/tests/scenarios/Xsl/XslTest.php b/tests/scenarios/Xsl/XslTest.php index f8de2ad572dbbca81576438351ea81ae72c9aacf..912288692140bf9aa552d80779e8a500667c6ae0 100644 --- a/tests/scenarios/Xsl/XslTest.php +++ b/tests/scenarios/Xsl/XslTest.php @@ -118,6 +118,9 @@ class XslNoticeajaxDetailDispatchTest extends AbstractControllerTestCase { $php_command = $this->mock() ->whenCalled('extension_loaded') + ->answers(true) + + ->whenCalled('unlink') ->answers(true); Class_Notice_Xsl::setPhpCommand($php_command);