diff --git a/VERSIONS_HOTLINE/59638 b/VERSIONS_HOTLINE/59638 new file mode 100644 index 0000000000000000000000000000000000000000..21953bd86b688bfd0ed626cdb63e84d772ce2cbb --- /dev/null +++ b/VERSIONS_HOTLINE/59638 @@ -0,0 +1 @@ + - ticket #59638 : Newsletter envoi version antérieure \ No newline at end of file diff --git a/library/ZendAfi/Controller/Plugin/Manager/Newsletter.php b/library/ZendAfi/Controller/Plugin/Manager/Newsletter.php index e755bb98021f3bd4e283f1d3f2338d80ac9a0d62..628c2b034a722dc46235992e559d84e635903065 100644 --- a/library/ZendAfi/Controller/Plugin/Manager/Newsletter.php +++ b/library/ZendAfi/Controller/Plugin/Manager/Newsletter.php @@ -72,7 +72,7 @@ function sendNewsletterClick(event) { $this->_addModelToView($newsletter); - $template = Class_Newsletter_Dispatch::newFrom($newsletter)->getTemplate(); + $template = Class_Newsletter_Dispatch::newVolatileFrom($newsletter)->getTemplate(); $mock_user = new Class_Entity(); $mock_user->setId(0)->setMail(''); diff --git a/tests/application/modules/admin/controllers/NewsletterControllerTest.php b/tests/application/modules/admin/controllers/NewsletterControllerTest.php index c194a39a9e1dc6ac7490ed284ecccff7d61fa89e..cc0b03dd785faa875ab4dc0f9c9138e73d20c647 100644 --- a/tests/application/modules/admin/controllers/NewsletterControllerTest.php +++ b/tests/application/modules/admin/controllers/NewsletterControllerTest.php @@ -868,6 +868,7 @@ class Admin_NewsletterControllerPreviewActionTest extends Admin_NewsletterContro $this->assertXPath('//div//img[@src="zork.jpg"]', $this->_response->getBody()); } + /** @test */ public function noticeShouldBePresent() { $this->assertQueryContentContains('p', 'Martine à la plage', $this->_response->getBody()); @@ -877,6 +878,12 @@ class Admin_NewsletterControllerPreviewActionTest extends Admin_NewsletterContro public function noticeMartineALaPlageUrlShouldBeRechercheViewNotice42() { $this->assertXPath('//a[@href="http://localhost' . BASE_URL . '/recherche/viewnotice/id/42"]'); } + + /** @test */ + public function templateShouldNotCreateNewsletterDispatch() { + $this->assertEmpty(Class_Newsletter_Dispatch::findAll()); + } + }