Skip to content
Snippets Groups Projects
Commit 42599470 authored by efalcy's avatar efalcy
Browse files

hotline #66006 : articleview not display article if is in draft mode

parent f716a6cd
Branches
Tags
2 merge requests!2485Master,!2476hotline #66006 : articleview not display article if is in draft mode
Pipeline #3353 failed with stage
in 24 minutes and 12 seconds
- ticket #66006 : affichage public d'articles en brouillon
\ No newline at end of file
......@@ -101,7 +101,7 @@ class CmsController extends ZendAfi_Controller_Action {
return;
}
if ($article->isArchived() && !Class_Users::isCurrentUserCanAccesBackend()) {
if (($article->isArchived() || $article->isStatusDraft()) && !Class_Users::isCurrentUserCanAccesBackend()) {
throw new Zend_Controller_Action_Exception($this->view->_('Désolé, cette page n\'existe pas'), 404);
return;
}
......
......@@ -1354,6 +1354,34 @@ class CmsControllerArticleViewWithModoTest extends CmsControllerWithFeteDeLaFrit
class CmsControllerArticleViewDraftTest extends CmsControllerWithFeteDeLaFriteTestCase {
protected function _loginHook($account) {
$account->ROLE_LEVEL = ZendAfi_Acl_AdminControllerRoles::MODO_BIB;
$account->PSEUDO = "bib";
}
public function setUp() {
parent::setUp();
Class_AdminVar::newInstanceWithId('WORKFLOW', ['valeur' => '1']);
Class_Article::find(224)->beDraft()->assertSave();
$this->dispatch('/cms/articleview/id/224', true);
}
/** @test */
public function responseShouldBeA404NotFound() {
$this->assertResponseCode(404);
}
/** @test */
public function pageShouldContainsH1WithNotFound() {
$this->assertXPathContentContains('//h1', 'Désolé, cette page n\'existe pas',$this->_response->getBody());
}
}
class CmsControllerArticleReadTest extends CmsControllerWithFeteDeLaFriteTestCase {
public function setUp() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment