Evergreen course materials tables should include fields required to trace editing history.

Bug #1915556 reported by Beth Willis
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Wishlist
Michele Morgan

Bug Description

The asset.course_module_course, asset.course_module_course_materials, asset.course_module_term and asset.course_module_role tables should be modified to include the following fields:

Creator bigint
Create_date timestamp with time zone
Editor bigint
Edit_date timestamp with time zone

Beth Willis (willis-a)
tags: added: course-materials
Revision history for this message
Beth Willis (willis-a) wrote :

The four fields specified in the original bug report should also display in the client as selectable columns in the grid and should be accessible from the EG reporter.

EG 3-7

Revision history for this message
Kyle Huckins (khuckins) wrote :

A patch is provided here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/khuckins/lp1915556-course-material-trace-editing-history

It should ne noted, however, that this will likely require a companion piece - as implemented, adding and editing courses and materials should automatically detect the user, but terms and roles may need more fleshing out.

tags: added: pullrequest
Revision history for this message
Kyle Huckins (khuckins) wrote :

Additional commit pushed to fix an incorrectly placed edit_time() call

Revision history for this message
Beth Willis (willis-a) wrote :

EG 3-8-0

The following fields have been added to the course_module_course_materials, course_module_course, course_module_term, course_module_role tables:

Creator
Editor
Create_time
Edit_time

These new fields display on the Course List, Terms, Course roles, and Course Materials grids. On the Course Materials page grid, the creator ID and editor ID display. It is preferable that the username display on the grid as it does on the other course materials grids.

The values for the creator and the editor are set to the default user (id=1) in the course_module_term, course_module_role and course_module_course_materials tables. The values for these fields are correct in the course_module_course table.

When editing a value for course, term or role, the edit_time does not update in the course_module_term, course_module_role and course_module_course tables. I am unable to confirm whether this is true when editing course materials as I have not yet been able to test that patch successfully.

Revision history for this message
Michele Morgan (mmorgan) wrote :

I've applied this patch to a test server running no other patches. I am unable to add a course or edit an item attached to a course.

When clicking Create Course, no modal appears. The console shows this error:

main.0fd19494acea4a16bac3.js:1 ERROR TypeError: _.creator is not a function
    at o.createNew (6389.e326a8821248710e8ae7.js:1:3800)
    at 6389.e326a8821248710e8ae7.js:1:1133
    at um (main.0fd19494acea4a16bac3.js:1:100257)
    at Object.l [as next] (main.0fd19494acea4a16bac3.js:1:100419)
    at k.__tryOrUnsub (main.0fd19494acea4a16bac3.js:1:456059)
    at k.next (main.0fd19494acea4a16bac3.js:1:455288)
    at j._next (main.0fd19494acea4a16bac3.js:1:454460)
    at j.next (main.0fd19494acea4a16bac3.js:1:454234)
    at Do.next (main.0fd19494acea4a16bac3.js:1:452334)
    at Do.emit (main.0fd19494acea4a16bac3.js:1:146378)

When selecting an existing item and choosing Edit Selected from the Actions menu, no modal appears. The console shows this error:

ERROR TypeError: t.edit_date is not a function
    at i (6389.e326a8821248710e8ae7.js:1:28960)
    at o.editSelectedMaterials (6389.e326a8821248710e8ae7.js:1:29042)
    at 6389.e326a8821248710e8ae7.js:1:25259
    at um (main.0fd19494acea4a16bac3.js:1:100257)
    at Object.l [as next] (main.0fd19494acea4a16bac3.js:1:100419)
    at k.__tryOrUnsub (main.0fd19494acea4a16bac3.js:1:456059)
    at k.next (main.0fd19494acea4a16bac3.js:1:455288)
    at j._next (main.0fd19494acea4a16bac3.js:1:454460)
    at j.next (main.0fd19494acea4a16bac3.js:1:454234)
    at Do.next (main.0fd19494acea4a16bac3.js:1:452334)

One likely issue is that the top commit on the working branch adds "edit_date" rather than "edit_time" to Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.ts

tags: added: needswork
removed: pullrequest
Revision history for this message
Kyle Huckins (khuckins) wrote (last edit ):

Good catch, not sure how this one slipped by, I've pushed an additional commit to fix the typo. This typo appears to be what was causing the issue Beth was describing, as well

tags: added: pullrequest
removed: needswork
Changed in evergreen:
importance: Undecided → Wishlist
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Changed in evergreen:
milestone: none → 3.10-beta
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Looks good! Thanks, Kyle. Pushed a signoff here, along with a small commit to remove some semicolons from the schema file: user/sandbergja/lp1915556-course-material-trace-editing-history-signoff

tags: added: signedoff
Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

This patch needs to be rebased against current master

Just making a note here that the following course_module_term fields need to be read only:

id
creator
editor
create_time
edit_time

removing signoff and adding a needsrebase tag.

tags: added: needsrebase
removed: pullrequest signedoff
Changed in evergreen:
milestone: 3.10-beta → 3.next
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Blake GH (bmagic) wrote :

Echoing the rebase. I started to rebase it and submit a collab branch, but I see that the asset.course_module_course_materials has had column revisions in the interim and there might be implications on this patch. Namely column "removal_time" may not be appropriate any longer since I don't see the other related time columns anymore (Creating User, Editing User, Create Time, Edit Time)

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.