ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Inconsistency in Api_channel_entries for the field "edit_date" ?

September 17, 2012 5:38am

Subscribe [2]
  • #1 / Sep 17, 2012 5:38am

    Blastmedia

    4 posts

    EE Version: 2.5.2

    I am not sure if it’s a bug or a feature, but it is somewhat related to this bug:
    https://support.ellislab.com/bugs/detail/18230

    When you create an entry, the edit_date is taken from the entry_date. But when you update an entry, the current time is used.
    It seems to me that the normal behavior should be to take the current time; the edit_date should not come from the entry_date field.

    Could someone confirm if the current behavior is the one intended?

    Thanks in advance!

  • #2 / Sep 18, 2012 6:08am

    Blastmedia

    4 posts

    To be a bit more accurate, in the folder expressionengine/libraries/api, there is a “Api_channel_entries.php” file.

    In this file, line 133, in the “submit_new_entry” function:

    'edit_date' => $this->EE->localize->decode_date('%Y%m%d%H%i%s', $data['entry_date'], TRUE),

    In the same file, line 269, in the “update_entry” function:

    'edit_date' => $this->EE->localize->decode_date('%Y%m%d%H%i%s', $this->EE->localize->now, FALSE),

    It seems to me that line 133 should be like line 269 because it seems to me that this field should only be changed by the system, not the user.

  • #3 / Sep 18, 2012 4:42pm

    Kevin Smith

    4784 posts

    On entry creation, it would make sense to take edit_date from entry_date since entry_date is the current time. That’s because the entry is being created right at that moment.

    Does that make sense?

  • #4 / Sep 19, 2012 4:00am

    Blastmedia

    4 posts

    Yes, it does indeed!
    I think my confusion comes from the fact that we change this date on certain occasions, even at the creation time, and we should not.

    Thank you for your answer!

    Have a nice day.

  • #5 / Sep 20, 2012 5:05pm

    Shane Eckert

    7174 posts

    Hey Blastmedia,

    I am glad that Kevin was able to help! That’s awesome.

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases