Apache Roller
  1. Apache Roller
  2. ROL-1932

Timestamps on approved comments are the current time, rather than the time posted

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: Comments
    • Labels:
      None

      Description

      I have comment moderation turned on for my blog for two reasons 1) it allows me to edit the HTML mistakes people make and make my comments look good and 2) it allows me to delete the spam.

      However, I've noticed that the comments get the timestamp of when I approve it, rather than the timestamp of when it was posted. I think it should be the time it's posted b/c otherwise it looks like everyone commented at the same time.

      Mailing list discussion: http://markmail.org/message/lifny3cfwitwirod

        Activity

        Hide
        Glen Mazza added a comment -

        Three committers--Dave, Shelan, and me-can't replicate on trunk.

        Show
        Glen Mazza added a comment - Three committers-- Dave, Shelan, and me -can't replicate on trunk.
        Hide
        Glen Mazza added a comment -

        Matt, which database are you using? Can this matter be fixed as not reproducible as neither Shelan nor Dave was able to replicate it? (If you'd like I can check myself with Roller trunk.)

        Show
        Glen Mazza added a comment - Matt, which database are you using? Can this matter be fixed as not reproducible as neither Shelan nor Dave was able to replicate it? (If you'd like I can check myself with Roller trunk.)
        Hide
        Dave Johnson (Inactive) added a comment -

        Mine looks like this and is apparently the same as yours, except for the default charset:

        CREATE TABLE `roller_comment` (
        `id` varchar(255) NOT NULL DEFAULT '',
        `entryid` varchar(255) NOT NULL DEFAULT '',
        `name` varchar(255) DEFAULT NULL,
        `email` varchar(255) DEFAULT NULL,
        `url` varchar(255) DEFAULT NULL,
        `content` text,
        `posttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
        `remotehost` varchar(128) DEFAULT NULL,
        `notify` tinyint(1) DEFAULT NULL,
        `referrer` varchar(255) DEFAULT NULL,
        `useragent` varchar(255) DEFAULT NULL,
        `status` varchar(20) NOT NULL DEFAULT 'APPROVED',
        `plugins` varchar(255) DEFAULT NULL,
        `contenttype` varchar(128) NOT NULL DEFAULT 'text/plain',
        PRIMARY KEY (`id`),
        KEY `co_entryid_idx` (`entryid`),
        KEY `rc_combo1_idx` (`posttime`),
        KEY `co_status_idx` (`status`),
        KEY `co_combo1_idx` (`status`,`posttime`)
        ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

        Show
        Dave Johnson (Inactive) added a comment - Mine looks like this and is apparently the same as yours, except for the default charset: CREATE TABLE `roller_comment` ( `id` varchar(255) NOT NULL DEFAULT '', `entryid` varchar(255) NOT NULL DEFAULT '', `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `url` varchar(255) DEFAULT NULL, `content` text, `posttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `remotehost` varchar(128) DEFAULT NULL, `notify` tinyint(1) DEFAULT NULL, `referrer` varchar(255) DEFAULT NULL, `useragent` varchar(255) DEFAULT NULL, `status` varchar(20) NOT NULL DEFAULT 'APPROVED', `plugins` varchar(255) DEFAULT NULL, `contenttype` varchar(128) NOT NULL DEFAULT 'text/plain', PRIMARY KEY (`id`), KEY `co_entryid_idx` (`entryid`), KEY `rc_combo1_idx` (`posttime`), KEY `co_status_idx` (`status`), KEY `co_combo1_idx` (`status`,`posttime`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
        Hide
        Matt Raible added a comment - - edited

        I think there might be something wrong with my comments table. Here's the create table syntax for it:

        CREATE TABLE `roller_comment` (
        `id` varchar(255) NOT NULL default '',
        `entryid` varchar(255) NOT NULL default '',
        `name` varchar(255) default NULL,
        `email` varchar(255) default NULL,
        `url` varchar(255) default NULL,
        `content` text,
        `posttime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
        `remotehost` varchar(128) default NULL,
        `notify` tinyint(1) default NULL,
        `referrer` varchar(255) default NULL,
        `useragent` varchar(255) default NULL,
        `plugins` varchar(255) default NULL,
        `contenttype` varchar(128) NOT NULL default 'text/plain',
        `status` varchar(20) NOT NULL default 'APPROVED',
        PRIMARY KEY (`id`),
        KEY `co_entryid_idx` (`entryid`),
        KEY `co_status_idx` (`status`),
        KEY `co_combo1_idx` (`status`,`posttime`)
        ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

        Would it be possible to simply alter the table to fix this?

        Show
        Matt Raible added a comment - - edited I think there might be something wrong with my comments table. Here's the create table syntax for it: CREATE TABLE `roller_comment` ( `id` varchar(255) NOT NULL default '', `entryid` varchar(255) NOT NULL default '', `name` varchar(255) default NULL, `email` varchar(255) default NULL, `url` varchar(255) default NULL, `content` text, `posttime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `remotehost` varchar(128) default NULL, `notify` tinyint(1) default NULL, `referrer` varchar(255) default NULL, `useragent` varchar(255) default NULL, `plugins` varchar(255) default NULL, `contenttype` varchar(128) NOT NULL default 'text/plain', `status` varchar(20) NOT NULL default 'APPROVED', PRIMARY KEY (`id`), KEY `co_entryid_idx` (`entryid`), KEY `co_status_idx` (`status`), KEY `co_combo1_idx` (`status`,`posttime`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Would it be possible to simply alter the table to fix this?
        Hide
        Dave Johnson (Inactive) added a comment -

        Matt, I cannot duplicate this on my local machine with either MySQL or Derby. Also, I can't make this happen on my blog at rollerweblogger.org. I tried creating some comments, then using the Comments page to approve and un-approve them, mark them as spam, etc. but no matter what I did the "post time" stayed the same.

        Are there some specific steps to reproduce this?

        Show
        Dave Johnson (Inactive) added a comment - Matt, I cannot duplicate this on my local machine with either MySQL or Derby. Also, I can't make this happen on my blog at rollerweblogger.org. I tried creating some comments, then using the Comments page to approve and un-approve them, mark them as spam, etc. but no matter what I did the "post time" stayed the same. Are there some specific steps to reproduce this?
        Hide
        Matt Raible added a comment -

        In the table definition, the default value is set to CURRENT_TIMESTAMP.

        The posttime attribute on the table was created with the clause 'on update CURRENT_TIMESTAMP' which is causing this effect.

        Should we revert this so it doesn't get updated everytime? It's a real pain, especially when I find old comments with formatting issues. I don't want to update a comment from 2007 and have it show up with today's date.

        Show
        Matt Raible added a comment - In the table definition, the default value is set to CURRENT_TIMESTAMP. The posttime attribute on the table was created with the clause 'on update CURRENT_TIMESTAMP' which is causing this effect. Should we revert this so it doesn't get updated everytime? It's a real pain, especially when I find old comments with formatting issues. I don't want to update a comment from 2007 and have it show up with today's date.
        Hide
        Shelan Perera added a comment -

        Hi,

        I was trying to reproduce this in the trunk development run. But i found that it gets the time stamp of the comment created not approved. Has this been fixed.?

        Show
        Shelan Perera added a comment - Hi, I was trying to reproduce this in the trunk development run. But i found that it gets the time stamp of the comment created not approved. Has this been fixed.?

          People

          • Assignee:
            David Johnson
            Reporter:
            Matt Raible
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development