overlaying a record from vandelay does not update editor/edit_date -- authority record edition

Bug #1587639 reported by Bill Erickson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned

Bug Description

Evergreen circa 2.10 -- affects all versions.

This is the authority record version of bug #957466. In short, overlaying authority records via vandelay should update the edit_date and editor.

Revision history for this message
Bill Erickson (berick) wrote :

Code, PGTAP test, and release notes pushed:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1587639-vand-auth-edit-date

Unlike bug #1447746 for bib records, editor and edit_date are always updated for authority records. This is due in part to the fact that authority records don't have a source value to update (the crux of bug #1447746 -- Well, there is an authority.record_entry.source column, but it is to my knowledge unused), but also there is currently no use case for a match-only merge with authority records, unlike bib records, which use them for loading holdings. IOW, all Vandelay authority merges/imports are considered record modifications.

tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.10.5
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

Removing milestones pending RM review, since this includes a DB change.

no longer affects: evergreen/2.9
Changed in evergreen:
milestone: 2.10.5 → 2.next
Revision history for this message
Mike Rylander (mrylander) wrote :

Bill,

It looks like the ARRAY_TO_STRING() call will cause a doubled comma in the SET list. Am I eyeballing that wrong?

Thanks!

Revision history for this message
Bill Erickson (berick) wrote :

I think I see what you're talking about. One of the commas is embedded in the string, though. It's funky to look at, but the end result is n fields and n-1 commas between them.

I copied the 'update_fields' bit directly from vandelay.overlay_bib_record(). For readability, we could change these:

update_fields := ARRAY_APPEND(update_fields, 'editor = ' || editor_id || ', edit_date = NOW()');

To these:

update_fields := ARRAY_APPEND(update_fields, 'editor = ' || editor_id);
update_fields := ARRAY_APPEND(update_fields, 'edit_date = NOW()');

In the existing vandelay.overlay_bib_record() and the new vandelay.overlay_authority_record(). In any event, the code appears to work as-is.

Thanks for the eyes, Mike.

Revision history for this message
Mike Rylander (mrylander) wrote :

/me stares harder ... yep, the embedded comma just threw me. IMO, readability is improved a bit by using the same spelling for all field additions, and the time spent at runtime is certainly swamped by the EXECUTE, so I +1 your suggested change.

It seems that it would not be difficult to arrange for a single (non-EXECUTE) update of the 'are' row. This would have the benefit of better performance and space reduction in the common case of a Vandelay-driven overlay of authority records, where the 905u will be set. In fact, if we capture the entire "old" row up front, instead of only the marc column, it should have no downside for the uncommon case of a missing 905u.

I can take that on if you're lacking tuits, or leave it to you. Submitter's choice.

Thanks, Bill.

Revision history for this message
Bill Erickson (berick) wrote :

+1 to single non-EXECUTE update. I'll leave it to you, Mike, but I'm happy to test/integrate the final product. Thanks.

Revision history for this message
Mike Rylander (mrylander) wrote :

I've signed off on your commits and added my suggested change to the tip.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/lp1587639-vand-auth-edit-date

Thanks!

Revision history for this message
Bill Erickson (berick) wrote :

Thanks Mike. I have signed off and pushed a small fix. PGTAP tests pass. I believe it's ready for prime time.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1587639-vand-auth-edit-date-2

Revision history for this message
Mike Rylander (mrylander) wrote :

Thanks, Bill. I squashed your fix in and pushed the set to master for 2.11.

Revision history for this message
Ben Shum (bshum) wrote :

Updating bug to indicate actual status

Changed in evergreen:
milestone: 2.next → 2.11-beta
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → 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.