Add create/edit dates and creator/editor fields to monograph parts table

Bug #1962757 reported by Tiffany Little
54
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Undecided
Unassigned

Bug Description

Wishlist.

I would like to see create date and creator fields on the biblio.monograph_part table. These would be really useful for reporting purposes.

For example, if there was a create date field, we could run a report on the newest created parts and send out the list to any libraries who are missing parts on that bib so they could add parts on their items.

tags: added: database
Revision history for this message
Janet Schrader (jackandharry) wrote :

Question, could this also help with finding libraries that create incorrect or nonstandard parts? Using standardized parts is necessary for effective research sharing when patrons place holds in the OPAC. Finding who the creator is could be used to indicate where training is needed.
Thanks,
Janet

Revision history for this message
Elaine Hardy (ehardy) wrote :

I think it would.

Revision history for this message
Ruth Frasur Davis (redavis) wrote :

This would be fantastic for exactly the reason Janet describes.

Revision history for this message
Christine Morgan (cmorgan-z) wrote :

Confirmed based on comments.

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Tiffany Little (tslittle) wrote :

Editing bug report to add that I think Last Editor and Last Edit Time should also be added, since you're able to edit (and merge) parts.

summary: - Add create date and creator fields to monograph parts table
+ Add create/edit dates and creator/editor fields to monograph parts table
Changed in evergreen:
assignee: nobody → Tiffany Little (tslittle)
Revision history for this message
Tiffany Little (tslittle) wrote :

I think this is ready for some testing. Branch here, with thanks to both Jason Boyer and Bill Erickson at the Hack-a-way for helping me with the last few pieces.

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/tlittle/LP1962757_Createedit_partsdata_repaired

tags: added: pullrequest
Changed in evergreen:
assignee: Tiffany Little (tslittle) → nobody
Revision history for this message
Christine Morgan (cmorgan-z) wrote :

Looks like a bit more work is need here. I can't get the Holdings Editor to load. I was logged in as br1mclark using Chrome browser. I tried clicking the Add Holdings button and also on the 2 Edit links for an item in the Item Table.

I'm seeing this in the console:

open-ils.cat.volcopy.data failed! stat=404 msg=Method [open-ils.cat.volcopy.data] not found for OpenILS::Application::Cat
onmethoderror @ net.service.ts:144

ERROR Error: Uncaught (in promise): open-ils.cat.volcopy.data failed! stat=404 msg=Method [open-ils.cat.volcopy.data] not found for OpenILS::Application::Cat
    at resolvePromise (zone.js:1214:31)
    at resolvePromise (zone.js:1168:17)
    at zone.js:1281:17
    at _ZoneDelegate.invokeTask (zone.js:409:31)
    at core.mjs:23896:55
    at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:23896:36)
    at _ZoneDelegate.invokeTask (zone.js:408:60)
    at Object.onInvokeTask (core.mjs:24197:33)
    at _ZoneDelegate.invokeTask (zone.js:408:60)
    at Zone.runTask (zone.js:178:47)
handleError @ core.mjs:8400

tags: added: needswork
removed: pullrequest
Revision history for this message
Christine Morgan (cmorgan-z) wrote :

Tested this again and this time the Holdings Editor loaded but I was not able to add a part.
- I tried adding from the Monograph Parts tab.  Clicking on the New Monograph Part button does nothing.
- I tried adding a part in the Holdings Editor in the part box and it does not save.

I was logged in as br1mclark again and did clear my cache.  I also tried from an incognito window.

This is what I am seeing in the console when I click the New Monograph Part button:

ERROR TypeError: t.creator is not a function
    at C.createNew [as action] (3294.3cbf24c6ddc12151.js:1:141499)
    at u.performButtonAction (2192.eb8f09a6e8acd70e.js:1:120228)
    at 2192.eb8f09a6e8acd70e.js:1:115347
    at vg (main.891491a9852b45df.js:3:166949)
    at c (main.891491a9852b45df.js:3:167116)
    at HTMLButtonElement.<anonymous> (main.891491a9852b45df.js:3:284375)
    at v.invokeTask (polyfills.639b7e14253a83b2.js:1:7210)
    at Object.onInvokeTask (main.891491a9852b45df.js:3:207031)
    at v.invokeTask (polyfills.639b7e14253a83b2.js:1:7131)
    at M.runTask (polyfills.639b7e14253a83b2.js:1:2575)

Changed in evergreen:
assignee: nobody → Christine Morgan (cmorgan-z)
Revision history for this message
Christine Morgan (cmorgan-z) wrote :

Testing on https://tiffany-main.gapines.org, I tested this two ways:

1. I added a monograph part to a record using the New Monograph Part button in the Monograph Parts tab in the bib record.
- The create date and edit date displayed the correct date and time in the grid in the Monograph Parts tab. The creator and editor displayed the username of the person I was logged in as.

2. I created a new holding by clicking on the Add Holdings button and added a part in the Parts dropdown before I saved the record.
- The create date and edit date displayed the correct date and time in the grid in the Monograph Parts tab. The creator and editor, however, displayed "1" instead of the username of the person I was logged in as. A screenshot is attached.

Changed in evergreen:
assignee: Christine Morgan (cmorgan-z) → nobody
Revision history for this message
Steven Mayo (stmayo) wrote :

Branch: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/smayo/LP1962757_Createedit_partsdata_rebase

Rebased closer to main, made some minor syntax error fixes to the upgrade script, and did some more testing.

It appears that the numbers appear while fleshing the creator or editor's username if you don't have VIEW_USER permission for the user you're trying to see. You'll still see the user's ID, (which is 1 for admin and probably what happened in comment #9) but it IS correctly tracking who created/edited the part.

In the attached picture, smalllane has VIEW_USER permissions only for her branch, and is able to read both her username and smallluthor's username but not admin(1) or lplsflamel(261).

I do think we should say that you don't have permission to see a username more gracefully - but tracking the creator and editor works. Different ticket?

Michele Morgan (mmorgan)
tags: added: pullrequest
removed: needswork
Changed in evergreen:
milestone: none → 3.13-beta
Changed in evergreen:
milestone: 3.13-beta → 3.13-rc
Revision history for this message
Steven Mayo (stmayo) wrote :

I have realized I misunderstood the problem described by Christine in comment #9. You can be logged into a user other than admin and create a new part on the Add Holdings screen and it will be saved as admin/1 anyway. Whether it's a number or not didn't matter so much as the fact it was the wrong number. Sorry about that.

Perl was dropping the creator and editor while saving a part made from a fleshed copy. Since Postgres didn't see a creator and editor, it was using the default of 1.

That should be fixed by the latest patch on this branch here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/smayo/LP1962757_Createedit_partsdata_rebase

Revision history for this message
Ruth Frasur Davis (redavis) wrote :

We tested this code in the collaborative code review and I consent to signing off on it with my name, Ruth Davis, and my email address <email address hidden>.

tags: added: signedoff
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.