Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
279
Merge Requests
35
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
1cb1eb80
Commit
1cb1eb80
authored
30 minutes ago
by
Brian Hatchet
Browse files
Options
Download
removing log
parent
431d06ca
feat/copy-entity-for-jury
1 merge request
!467
When an entity gets reported, save a copy that can't be edited
Pipeline
#119067981
passed with stages
in 7 minutes and 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
Core/Reports/Report.php
View file @
1cb1eb80
...
...
@@ -87,19 +87,26 @@ class Report
private
$userHashes
;
/** @var array $stateChanges */
private
$stateChanges
;
private
$stateChanges
=
[
'reported'
];
/**
* @param string $state pushes a state into our state change array
* @return Report this
*/
public
function
setState
(
string
$state
)
:
Report
{
$this
->
stateChanges
[]
=
$state
;
}
/**
* Return the state of the report from the state changes
*/
public
function
getState
()
public
function
getState
()
:
string
{
if
(
!
$this
->
stateChanges
)
{
return
'reported'
;
}
$sortedStates
=
$this
->
stateChanges
;
arsort
(
$sortedStates
);
return
key
(
$sortedStates
)
;
return
$sortedStates
[
0
]
;
}
/**
...
...
This diff is collapsed.
Core/Reports/UserReports/Manager.php
View file @
1cb1eb80
...
...
@@ -61,7 +61,6 @@ class Manager
{
// Return the latest report, or the same supplied report if none exist
$report
=
$this
->
reportsManager
->
getLatestReport
(
$userReport
->
getReport
());
if
(
$report
->
getState
()
!==
'reported'
&&
!
in_array
(
$report
->
getEntity
()
->
type
,
[
'user'
,
'group'
],
true
)
)
{
...
...
This diff is collapsed.
Please
register
or
sign in
to comment