Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Plugins by

I am asking about this plugin here: https://github.com/pupi1985/q2a-post-merge

To get the context of this plugin, see http://www.question2answer.org/qa/45474/merge-questions-plugin-why-it-suggesting-that-there-is-error

I noted that the table qa_content_words is not modified when I merge one question with another. See my example... I merged questions 1186 and 1189 (I mean 1186 => 1189), i. e., the answers of question 1186 became the answers of question 1189. 

This part of the table is:

postid wordid count type questionid
1187 10415 1 A 1186
1188 10416 1 C 1186
1189 10417 1 Q 1189

qa_postmeta is

meta_id post_id meta_key meta_value
1 1186 merged_with 1189

I ask:

1) "questionid" of the first two lines should be 1189 now? If YES, there is any implication of this?

2) There is also a reference to question 1186 in qa_userevents

userid entitytype entityid questionid lastpostid updatetype lastuserid updated
1 - 0 1186 1186 H NULL 2015-07-11 12:03:23

Is this correct? What is the purpose of this?


Q2A version: 1.7.0

1 Answer

+2 votes
selected by
Best answer

As I mentioned in some other post, you shouldn't blindly trust any plugin that modifies core tables. It's even worse if the modification happens by a raw SQL query.

1) Yes, it should

2) That is something that the core handles. It seems it should be OK for it to have those records in the ^userevents and the ^sharedevents tables. Anyway, after taking a closer look at how the core handles post deletions with regards to those tables, I conclude that the user one would eventually be deleted while the shared one won't. I guess there should be some cleanup in the core for the shared event too regarding deleted posts. Anyway, this is not serious at all.

As a side note, I created a new release of that plugin that considerably improves post movement. I basically threw away all NoahY did there and rewrote it from scratch. Give it a try and let me know if you find any issue.