PPL

editing stories should create logs

Bug #712558 reported by Christopher Adams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PPL
Fix Released
Medium
Bassel Safadi

Bug Description

Adding or editing a story should create a new record in ppl_logs:

owner_id = [userid]
log_type = 1
created_at = CURRENT_TIME
message = [username] edited story_title

where "story_title" is the title of the story being edited

the log_type is 1 because from ppl_log_types, 1 maps to "Notice"

If the story is called "Jon is my friend", then on my dashboard I should see a log entry that reads:

christopher edited Jon is my friend

Changed in ppl:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Christopher Adams (christopheradams)
milestone: none → 0.2
description: updated
Revision history for this message
Christopher Adams (christopheradams) wrote :

Bassel's input was to first create a ppl_logs table. (Done).

Then create fields that insert a value for the four columns in ppl_logs:

owner_id->ppl_log|SystemGOD:owner_id:value:[userid]

etc.

If this approach fails, the other option is to create an event that calls a php script to do the insertions.

Changed in ppl:
assignee: Christopher Adams (christopheradams) → Brad Phillips (brad-bradphillips)
Revision history for this message
Christopher Adams (christopheradams) wrote :

How is the concept of current time handled in aiki forms?

description: updated
description: updated
Changed in ppl:
assignee: Brad Phillips (brad-bradphillips) → Bassel Safadi (bassel)
description: updated
Revision history for this message
Bassel Safadi (bassel) wrote :

now it works when adding, had to fix a bug in aiki to make the date work.
also changed the field name of created_at in ppl_stories because in one form two fields can not have the same name even if they are from different tables

Revision history for this message
Bassel Safadi (bassel) wrote :

all secondary fields are now autofield, so they work and the editing work while they don't break the editing

Changed in ppl:
status: Confirmed → Triaged
Revision history for this message
Bassel Safadi (bassel) wrote :

Note that there are two types of vars between []
like in this:
value:[username] edited [story_title]

where [username] is system wide and get replaced with the current logged in user. while [story_title] get replaced with the value of the field story_title that was posted in this form

Revision history for this message
Bassel Safadi (bassel) wrote :

ok this took extra work, after few hours I finished adding the functionality for inserting new record in log when editing. it's in commit number 672 now updated to ppl as well:

new feature: secondery_queries inside forms now insert into the secondery table when the original field updates

now a new log is created whenever the user add story or edit it..
we have cool new feature in aiki, it was easier to just implement this the way Christopher threatened to do if this is not complete by noon ;-) but it's now easier for future development..

this is documented on http://aikiframework.org/wiki/Defining_db_tables_and_fields but it seems it need more clarification specially for the part where new record get inserted on update.. Chris can you help on the documentation please

Changed in ppl:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.