Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.4k views
in Q2A Core by
closed by
As I know in posts table only the last lasted by information is stored and all histihiof edits are not maintained. Is there someway this can be added in core?
Q2A version: 1.8
closed with the note: For plugin
by
Why does it have to be added to the core and not as a plugin?

1 Answer

+1 vote
by

I don't think this should be added to the core. Not all sites need it and it requires some additional processing of posts when performing actions on them.

The core should provide the means for plugin developers to actually be able to implement this. That's the idea of the core. And, in fact, it actually provides this feature. Furthermore, a plugin has already been implemented https://github.com/svivian/q2a-edit-history. So the feature itself is present not exactly where you want it.

by
Not exactly. What I meant is not the Edit history but who all have edited a post. Like in SO,  in a post we can see who all have edited it, but in Q2A only the last editor is shown.
by
What is the difference between the "edit history" and "who all have edited a post"? Isn't that part of the plugin?
by
Edit history also has the edited content. And my point is mainly with regard to "updated" column of qa_posts table. What is the use of this if it only shows the last update?
by
Sorry I don't understand what you're talking about. What do you think is missing to this history? https://imgur.com/a/O8iEerO
by
No information is missing there. But the information is not in qa_posts table and hence not used by any theme. In the below image, only the last edited information is shown. Are you saying that, this must be done by a theme layer in a separate plugin?

https://drive.google.com/file/d/1X6ylAAaVNUcP6F-G0Cu-jcpd_oEKVL_n/view?usp=sharing
by
It makes sense for the core not to have that information. It is not minimal information required by a Q&A site. It might be for your site, but not for all. That can be confirmed by just seeing the feature requests of previous Q2A versions.

It makes sense for the theme not to have that information. A theme should only care about the look and feel of the questions and answers and should also provide a consisten way for plugins to extend Q2A being supported by the same look and feel as the theme.

It makes sense for plugins to have that information as they extend the features (and data that can be stored) that the core has. Furthermore, layers extend the theme, so even plugins can change how things look like.

Now, I'm trying to figure out what you want. Let me see if I understand.
 * You mentioned that "Like in SO, in a post we can see who all have edited it, but in Q2A only the last editor is shown." and in the plugin I linked you can see that, just as SO.
 * You linked an image that has the latest edition day for the post in the meta. Just like SO does. But your comment states "only the last edited information is shown"

Is it correct to assume that what you want to see is extending the metas and having one per edition displayed in the post view? E.G:

asked Dec 13, 2018 in Plugins by someone
edited 3 hours ago by someoneelse
edited 2 hours ago by somebody
edited 42 minutes ago by somebodyelse

That is not part of SO and can increase the meta height whenever there are many edits. Am I understanding correctly? If not, post an image of what you'd like to see.
by
Yes Pupi. That's exactly what I meant. But I see the problem you are telling and as I see in SO this is not there -- I remember seeing this sometime ago in SO where multiple persons where shown as edited by but not sure.

But the current edited by in Q2A shows the Last edited person. The problem here is someone might have done a lot of edits and then another person comes and just fix a typo. The metadata only shows the last person name. May be it's better to store the person with maximum edit or we need a minimum amount of edits to be qualified to become an editor for the post.

Now one other problem is if someone edits an answer and then some other selects it as best answer, the metadata only shows selected by. I suppose this has to do with the theme not displaying the editor or is it inherent to Q2A that?
by
I haven't seen this in SO (except for the review history). Furthermore, the current edited by in SO also shows the last edited person, just like Q2A.

Regarding changing the algorithm to the maximum edit is something that probably you could find useful but I (and SO) don't think it makes sense for the core (or the theme, as you mentioned again in your comment). Apart from the feature itself, implementing that logic would require to count the amount of edits that EACH user will have in EACH post. So that means even more processing.

Regarding the "other problem" which is showing the "selected by" replacing the last edit, I don't think that is a "problem". I'm perfectly fine with that: it makes sense and is efficient. If you want history, you can leverage the event module for that.

Anyway, it is quite suitable for a plugin. In fact, I'm currently working in something somehow related to that (tracking amount of approves, rejects and edits per user). So in a separate page I display the post metadata and, as another metadata line, I show the "approved/rejected/edited by" line. Unless the theme is a mess you can do that with a layer.
by
Thank you Pupi for the clarification. So I would do all these in the plugin only.

In the last paragraph are you telling about - Edit approvals which is not there in Q2A at present? If so I would like to have that as well :)
by
No, it is just approve and rejects of posts. The important thing there was the idea of showing, apart from an "asked by" or "edited by", also a "rejected by", for example.
by
oh okay. Very nice feature for a well moderated community. Can substitute the "Admin Activity" feature of FB groups.
...