PPL

Comment 4 for bug 723558

Revision history for this message
Christopher Adams (christopheradams) wrote : Re: [Bug 723558] [NEW] editing a story resets the date to 0

Can you confirm that created_at is only set once when the story is created?

It's also possible to have the updated_at set automatically by the
database whenever the record is changed. Ue phpmyadmin to set this.

On Saturday, February 26, 2011, Brad Phillips <email address hidden> wrote:
> I was able to get this working by, first, adding a new form to the
> ppl_stories table (form 39: ppl_story_edit).  This form is called in the
> story_edit widget (instead of the original form 25).
>
> To stop the creation date from being messed with, I simply removed the
> field from the aiki form (so that date couldn't be overwritten in the
> new form).  I had to test a few different solutions for the update date,
> but was finally able to arrive at a solution by doing the following:
>
> -I noticed the update date was being addressed twice on the form (once
> to insert into ppl_stories & again into ppl_logs) & I knew that aiki was
> capable of inserting 1 value into 2 tables at the same time, so I
> deleted the autofield|updated_at field & changed the 2nd instance to the
> following code:
>
> "autofield"=>"created_at->ppl_logs|SystemGOD:created
> at:datetime:[updated_at]"
>
> The [updated_at] on the end successfully inserts the datetime into table
> 1 & the "created_at->ppl_logs" continues to successfully update the
> 'created_at' field in ppl_logs.
>
> ** Changed in: ppl
>     Assignee: (unassigned) => Brad Phillips (brad-bradphillips)
>
> --
> You received this bug notification because you are a member of PPL
> Developers, which is subscribed to PPL.
> https://bugs.launchpad.net/bugs/723558
>
> Title:
>  editing a story resets the date to 0
>
> Status in PPL:
>  Fix Released
>
> Bug description:
>  When the Owner creates a story and then edits it, then both the
>  created_at_date and updated_at fields get reset to 0000-00-00
>  00:00:00.
>