Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Quentin CHEVILLON
opacce
Commits
28e86bf4
Commit
28e86bf4
authored
Aug 10, 2021
by
Sebastien ANDRE
Browse files
hotline #119892 : action invisble should save without validation
parent
90c92c4f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
8 deletions
+55
-8
VERSIONS_HOTLINE/119892
VERSIONS_HOTLINE/119892
+1
-0
application/modules/admin/controllers/ModoController.php
application/modules/admin/controllers/ModoController.php
+14
-7
library/Trait/Avis.php
library/Trait/Avis.php
+6
-0
tests/application/modules/admin/controllers/AdminAvisModerationControllerTest.php
...s/admin/controllers/AdminAvisModerationControllerTest.php
+34
-1
No files found.
VERSIONS_HOTLINE/119892
0 → 100644
View file @
28e86bf4
- ticket #119892 : Administration : Correction de l'archivage des avis de notices du magasin de thèmes
\ No newline at end of file
application/modules/admin/controllers/ModoController.php
View file @
28e86bf4
...
...
@@ -38,14 +38,21 @@ class Admin_ModoController extends ZendAfi_Controller_Action {
public
function
invisibleavisnoticeAction
()
{
if
(
!
$review_id
=
$this
->
_request
->
getParam
(
'id'
,
0
))
$this
->
_
forward
(
'index'
);
if
(
!
$review_id
=
$this
->
_request
->
getParam
(
'id'
,
0
))
return
$this
->
_
redirectToAvisNotice
(
);
if
(
!
$review
=
Class_AvisNotice
::
find
(
$review_id
))
return
$this
->
_
forward
(
'index'
);
if
(
!
$review
=
Class_AvisNotice
::
find
(
$review_id
))
return
$this
->
_
redirectToAvisNotice
(
);
$review
->
setFlags
(
Class_AvisNotice
::
ARCHIVED_FLAG
)
->
save
();
$this
->
_stayOnPage
();
if
(
!
$review
->
setFlagArchived
()
->
beImportMode
()
->
save
())
{
$this
->
_helper
->
notify
(
$this
->
_
(
'Une erreur c\'est produite l\'avis n\'a pas pu être archivé.'
));
return
$this
->
_redirectToAvisNotice
();
}
$this
->
_helper
->
notify
(
$this
->
_
(
'Avis archivé'
));
$this
->
_redirectToAvisNotice
();
}
...
...
library/Trait/Avis.php
View file @
28e86bf4
...
...
@@ -138,4 +138,10 @@ trait Trait_Avis {
public
function
isAvisNotice
()
{
return
'notices_avis'
==
$this
->
_table_name
;
}
public
function
setFlagArchived
()
{
$this
->
setFlags
(
static
::
ARCHIVED_FLAG
);
return
$this
;
}
}
tests/application/modules/admin/controllers/AdminAvisModerationControllerTest.php
View file @
28e86bf4
...
...
@@ -484,4 +484,37 @@ class AdminAvisModerationControllerCmsValidateAvisTest extends AdminAvisModerati
}
}
?>
\ No newline at end of file
/* hotline : #119892 */
class
AdminAvisModerationControllerEnteteEmptyTest
extends
AdminAvisModerationControllerTestCase
{
protected
$_avis_notice
;
public
function
setUp
()
{
parent
::
setUp
();
$this
->
_avis_notice
=
Class_AvisNotice
::
find
(
38
);
$this
->
_avis_notice
->
beImportMode
()
->
setEntete
(
''
)
->
save
();
$this
->
dispatch
(
'/admin/modo/invisibleavisnotice/status/0/active_tab/1/page/0/id/38'
);
}
/** @test */
public
function
statusShouldBeArchived
()
{
$this
->
assertEquals
(
Class_AvisNotice
::
ARCHIVED_FLAG
,
$this
->
_avis_notice
->
getFlags
());
}
/** @test */
public
function
flashMessengerShouldContainsAvisArchive
()
{
$this
->
assertFlashMessengerContentContains
(
'Avis archivé'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment