Editing post doesnt mark post as edited

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
spone
Registered User
Posts: 2
Joined: Sat Jan 26, 2008 11:00 pm

Editing post doesnt mark post as edited

Post by spone »

A fews days ago I did a fresh install of phpBB 3.0 gold on a Linux server provided by my webhost.

I must say that phpBB is running fine, except one thing: in case a post is edited, it should be marked as such, but nothing appears below the post (like "edited by username on date at time"). When I check the database table phpbb_posts, I notice that the fields post_edit_time, post_edit_reason and post_edit_count are left completely untouched. When I manually enter some random valid data there, the forum does show that the post has been edited.

I think I can pretty say for sure the issue is not with the template or style, and I have the feeling that the posting code just forgets to check whether or not edits should be marked. For completeness' sake: the
'Display last edited time information' option in the ACP is set to yes.

Thanks in advance!

Version of phpBB3: 3.0 Gold
Was this a fresh install or a(n) update/upgrade/conversion (please be specific)? fresh install
Was this an install through your host? Nope, did it myself.
MODs you have installed: none
When the problem started: since installation.

Additionally, you may wish to provide the following (where applicable)
Template(s) used: n/a
Language(s) used: default, english
Version of PHP used: 5.2.3
Database and version used: Mysql 5.0.22
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Editing post doesnt mark post as edited

Post by Erik Frèrejean »

It will only be marked as edited when there was already an reply on the original post, or when a moderator/admin edit the post and give up an reason for the edit.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
spone
Registered User
Posts: 2
Joined: Sat Jan 26, 2008 11:00 pm

Re: Editing post doesnt mark post as edited

Post by spone »

Thanks for clearing this up. Now im wondering though if there is any way to change this behavior to have the forum show edits all the time :)
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Editing post doesnt mark post as edited

Post by Erik Frèrejean »

Yes you should be able to change this with a little hack in posting.php, but at the moment I can't have a look at it for you. But maybe someone else around here :).
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
User avatar
philwhite
Registered User
Posts: 122
Joined: Wed Aug 22, 2007 12:47 am
Contact:

Re: Editing post doesnt mark post as edited

Post by philwhite »

I've been trying to solve this one for some time.

The current behaviour of PHPBB3 seems to be that it only updates the edit count if
  • the user edits the post AND a reply to the post has been posted
  • or a moderator edits the post AND supplies an edit reason
The editing information is currently only displayed at all if an editing reason has been supplied, and this option is only available to moderators.

The first is perfectly good behaviour. The second is wacky.

I rectified it as follows:

in viewtopic.php
find

Code: Select all

if ($row['post_edit_reason'])
replace with

Code: Select all

if ($row['post_edit_count'])
Someone with some greater knowledge and experience should confirm that I got this right.
It's only words...
Wordwizard.com
User avatar
dJomp
Registered User
Posts: 22
Joined: Mon Nov 24, 2003 2:45 pm
Location: York, UK
Contact:

Re: Editing post doesnt mark post as edited

Post by dJomp »

Unfortunately that won't update the edit count if a moderator edits and doesn't change the edit reason (I found that giving a reason, and then removing it, made 2 edits).

I'm heading into posting.php in a minute to see what's going on.
User avatar
Eelke
Registered User
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Editing post doesnt mark post as edited

Post by Eelke »

philwhite wrote:The first is perfectly good behaviour. The second is wacky.
I think both are a matter of opinion.

The first is what phpBB2 did, and there are certainly good reasons to do it like this. The idea is, editing the last post can not take following posts out of context (because there are none), so it's not important if a post has been edited. It does allow someone to make a quick change after posting. An argument against this behaviour is that someone might already have read the post before it was edited, so it would actually be a good thing to let them know the post has been changed.

I personally think the second behaviour makes more sense than the first. If a moderator would leave out an edit reason, maybe they have some reason to not want to show the post was edited at all. You might argue there are no good reasons to not inform users their post has been edited, and you might be right, but if you can trust your moderators enough to always supply an edit reason anyway, you might want to allow them to do "invisible" edits for whatever unforeseen circumstance.
User avatar
dJomp
Registered User
Posts: 22
Joined: Mon Nov 24, 2003 2:45 pm
Location: York, UK
Contact:

Re: Editing post doesnt mark post as edited

Post by dJomp »

If you do want to make phpBB3 mark edits all round:

Head to includes/functions_posting.php

Find:

Code: Select all

if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post')))
Replace with:

Code: Select all

if ($data['post_edit_reason'] || $post_mode == 'edit' || $post_mode == 'edit_first_post' || ($post_mode == 'edit_last_post' && $user->data['user_id'] != $poster_id))
This will log all changes a moderator makes; including editing the last post in a thread - but a user can still edit their own post (when last in thread) without a notice.
User avatar
vsabah
Registered User
Posts: 358
Joined: Wed Apr 05, 2006 5:57 pm
Location: Konya / Türkiye
Contact:

Re: Editing post doesnt mark post as edited

Post by vsabah »

Thanks dJomp!!! ;)
User avatar
waxxie
Registered User
Posts: 119
Joined: Fri Oct 16, 2009 5:21 pm

Re: Editing post doesnt mark post as edited

Post by waxxie »

I needed to show all edits

so I did this in "includes/functions_posting.php"

Replace

Code: Select all

if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post')))
With

Code: Select all

if ($data['post_edit_reason'] || $post_mode <> '')
so far, it works 100%

:)
User avatar
dontcoz
Registered User
Posts: 491
Joined: Mon Sep 29, 2008 9:49 pm
Location: Vancouver, BC
Contact:

Re: Editing post doesnt mark post as edited

Post by dontcoz »

waxxie wrote:I needed to show all edits

so I did this in "includes/functions_posting.php"

Replace

Code: Select all

if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post')))
With

Code: Select all

if ($data['post_edit_reason'] || $post_mode <> '')
so far, it works 100%

:)
this does work 100% - nice:)

can you make it sign only the mods not the reg users?
User avatar
dontcoz
Registered User
Posts: 491
Joined: Mon Sep 29, 2008 9:49 pm
Location: Vancouver, BC
Contact:

Re: Editing post doesnt mark post as edited

Post by dontcoz »

bump.. in hope that somebody knows:).. thanks in advance.
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Editing post doesnt mark post as edited

Post by Erik Frèrejean »

Untested:

Code: Select all

if (($data['post_edit_reason'] || $post_mode <> '') && $auth->acl_get('m_')) 
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
User avatar
dontcoz
Registered User
Posts: 491
Joined: Mon Sep 29, 2008 9:49 pm
Location: Vancouver, BC
Contact:

Re: Editing post doesnt mark post as edited

Post by dontcoz »

Erik Frèrejean wrote:Untested:

Code: Select all

if (($data['post_edit_reason'] || $post_mode <> '') && $auth->acl_get('m_')) 
thanks erik! that one almost worked:).. the only prob with it is that it shows all the old edits made by regs and mods as well as the new ones made only by mods.. ideally it would only sign the mod edits.
Locked

Return to “[3.0.x] Support Forum”