akeeba / engage

Akeeba Engage - Comments for Joomla!™ articles made easy
GNU General Public License v3.0
16 stars 10 forks source link

Do not print "Edited on" when edit date is the same as creation date + minor French translation #264

Closed NicolasDerumigny closed 1 year ago

NicolasDerumigny commented 1 year ago

Summary of Changes

Do not print "Edited on" when edit date is the same as creation date.

Testing Instructions

Result before applying PR

"Edited on ... by ..." messages on the front-end are displayed for every registered (non guest) user, even when the message has not been edited.

Result after applying PR

"Edited on ... by ..." messages on the front-end are displayed correctly.

Backwards compatibility

It should be good as no new interface are being used.

Documentation Changes Required

None.

Translation impact

Add the French translation for "Edited by ... on ... "

Technical information

I do not know why the logged-in users are seen as "editing". This may be related to a bug / incompatibility in the saving process.

nikosdion commented 1 year ago

This doesn’t look right.

When a comment has not been modified its modified_on is NULL. It won’t be NULL if the comment had been edited. Sure you can pretend it was edited on or before the date and time it was submitted but the fact remains that the comment is edited and has to be marked as such.

This PR aims to conceal the fact that the comment has been edited if the user has enough privileges to edit the modification date and make it identical to the creation date. This is problematic as it is designed to mislead the people reading the comments.

I won’t accept this PR for this reason.

You can of course do a template override on your side to conceal the fact that a comment has been edited based on whatever criteria you want. I just don’t want to implicitly endorse this behavior by enshrining it in code.

NicolasDerumigny commented 1 year ago

When a comment has not been modified its modified_on is NULL. It won’t be NULL if the comment had been edited.

This is not what I observe on my server (last akeeba engage development version). On mine, modified_on is not NULL for comments created by non-guest users, and is set to the creation date. I am using TinyMCE and a few plugins, so that may be the issue. I'll come back when I found why.

nikosdion commented 1 year ago

Have you set your comments to need to be manually published by an administrator?

NicolasDerumigny commented 1 year ago

No, everything is in direct publication.

nikosdion commented 1 year ago

The modified was accidentally set when submitting a comment. I fixed that.

I followed a different approach to yours for avoiding the display of the “Edited” label for existing comments. I am checking both the date/time stamp and the users who created and modified the comment. Also, there's no need to go through the (slow) \Joomla\CMS\Date class as we can simply check the raw date/time strings for equality.

NicolasDerumigny commented 1 year ago

Perfect, then I will wait for the new dev release to test that. I will do another PR for the French translation!