Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
8b22a9bf
Commit
8b22a9bf
authored
Jan 11, 2019
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear cache when posts are hidden
parent
0f7262d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
post-update.php
qa-include/app/post-update.php
+18
-0
No files found.
qa-include/app/post-update.php
View file @
8b22a9bf
...
...
@@ -427,6 +427,8 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie
}
}
qa_question_uncache
(
$oldquestion
[
'postid'
]);
// remove hidden posts immediately
$eventparams
=
array
(
'postid'
=>
$oldquestion
[
'postid'
],
'parentid'
=>
$oldquestion
[
'parentid'
],
...
...
@@ -618,6 +620,18 @@ function qa_post_unindex($postid)
/**
* Delete the cache for a question. Used after it or its answers/comments are hidden, to prevent them remaining visible to visitors/search engines.
* @param int $questionId Post ID to delete.
* @return bool
*/
function
qa_question_uncache
(
$questionId
)
{
$cacheDriver
=
Q2A_Storage_CacheFactory
::
getCacheDriver
();
return
$cacheDriver
->
delete
(
"question:
$questionId
"
);
}
/**
* Change the fields of an answer (application level) to $content, $format, $notify and $name, then reindex based on
* $text. For backwards compatibility if $name is null then the name will not be changed. Pass the answer's database
* record before changes in $oldanswer, the question's in $question, and details of the user doing this in $userid,
...
...
@@ -801,6 +815,8 @@ function qa_answer_set_status($oldanswer, $status, $userid, $handle, $cookieid,
}
}
qa_question_uncache
(
$question
[
'postid'
]);
// remove hidden posts immediately
$eventparams
=
array
(
'postid'
=>
$oldanswer
[
'postid'
],
'parentid'
=>
$oldanswer
[
'parentid'
],
...
...
@@ -1182,6 +1198,8 @@ function qa_comment_set_status($oldcomment, $status, $userid, $handle, $cookieid
$oldcomment
[
'format'
],
qa_viewer_text
(
$oldcomment
[
'content'
],
$oldcomment
[
'format'
]),
null
,
$oldcomment
[
'categoryid'
]);
}
qa_question_uncache
(
$question
[
'postid'
]);
// remove hidden posts immediately
$eventparams
=
array
(
'postid'
=>
$oldcomment
[
'postid'
],
'parentid'
=>
$oldcomment
[
'parentid'
],
...
...
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