Can't Edit and Delete Stat Cat Entries in Web Client

Bug #1752367 reported by Jason Boyer
208
This bug affects 42 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

Updating this description since the patron and item statistical category editors have been ported to Angular as separate interfaces as of 3.12.

With this port (bug 1857911), editing and deleting statistical category entries was intentionally disabled pending further discussion, which has begun here.

Revision history for this message
Kathy Lussier (klussier) wrote :

Adding a note from the duplicate bug that stat cat entries also cannot be deleted.

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
tags: added: webstaffclient
tags: added: cataloging
Anna Goben (agoben)
tags: added: patron statcats
Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

Stat cats can be edited and deleted in the proposed angular port of the stat cat interface; however, I'm not sure the end result is the desired behaviour.

https://bugs.launchpad.net/evergreen/+bug/1857911

When a patron stat cat value is edited the value in the patron account is not updated to match. The old value remains as the chosen value and the edited version is now available from the drop down menu.

When a item stat cat is edited the value in the item editor displays with the edited version. I'm not sure whether the edited version is saved in the item record as there's no way to view the value without running a report.

When a patron stat cat value is deleted the value remains in the patron account but no longer displays in the dropdown.

When an item stat cat value is deleted it no longer displays in the drop down in the item editor. Again I'm not sure whether or not the original value is still saved in the item record.

summary: - Can't Edit Stat Cat Entries in Web Client
+ Can't Edit and Delete Stat Cat Entries in Web Client
tags: removed: webstaffclient
Revision history for this message
Beth Willis (willis-a) wrote :

3.11.1

Still cannot edit or delete stat cat entries

Revision history for this message
Susan Morrison (smorrison425) wrote :

3.12 in Chrome and Firefox - confirmed there's no ability to edit or delete item or patron stat cat entries.

Revision history for this message
Terran McCanna (tmccanna) wrote :

Adding needsdiscussion tag because there has not been a decision made on the desired behavior if a stat cat entry is edited or deleted after it has already been applied to a user or item.

Note that the options to edit and delete entries were specifically disabled in the Angularization project (https://bugs.launchpad.net/evergreen/+bug/1857911 - comment 50).

See also, Jennifer's comment #2 above.

tags: added: needsdiscussion
Michele Morgan (mmorgan)
description: updated
Revision history for this message
Elizabeth Thomsen (et-8) wrote :

This has the needsdiscussion tag, so let's have the discussion and move this forward. Patron and item statistical categories work differently and I don't know if there's a reason to change that. NOBLE doesn't use patron statistical categories much but we use item statistical categories extensively -- libraries really like being able to essentially add their own attributes to items to track all sorts of things.

For item statistical categories, here's what we expect:

* When you delete a value from a statistical category, it no longer displays in the list of values or in any item records.

* When you edit a value from a statistical category, the new value replaces the earlier version in the list of values and the new value replaces the earlier version in the item records. This is similar to the way shelving locations work when deleted or edited.

Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

We'd also like to see the item stat cats behave as Elizabeth describes.

However, we'd like to see patron stat cats behave the same.

If a patron stat cat entry is deleted it should be removed from the list of values and any patron records. If a stat cat value is edited the new value should be used on the patron record.

Revision history for this message
Kathy Lussier (klussier) wrote :

Does anyone disagree with the desired behavior described by Elizabeth and Jennifer? If not, could we remove the needsdiscussion tag?

Revision history for this message
Galen Charlton (gmc) wrote :

Noting that there's an implementation detail to be aware of: item stat cats link items to defined values, so changing a stat cat value or deleting it can inherently update all of the items that it's linked to. Patron stat cats are fundamentally free text, so deleting or updating a value (actor.stat_cat_entry) would need additional code to propagate changes down.

That said: I agree that it would good to have an option to do batch changes and deletions from the stat cat administrative interface - the patron side just would need a little more work.

Revision history for this message
Lindsay Stratton (lstratton) wrote :

I agree that both item and patron stat cats should function in the same way, that all stat cats and values should be delete-able and editable, any changes should update the records to which they are applied, and entries should be defined values.

Revision history for this message
Tiffany Little (tslittle) wrote (last edit ):

I'm working on a cleanup of our item stat cats, so I'm coming back to this bug.

I have a question/clarification regarding deleting item statcat entries. If the entry is deleted, should it be removed from *all* item records--even deleted ones? I'm inclined to think not, because there's no way (aside from DB access) to access those items to replace that value if something else is more appropriate.

But if that's the case that they should be retained on deleted item records, then the entry can't be purged from the database because there's still a linkage between that item at the statcat entry. So should statcat entries have a Deleted? flag instead, like shelving locations?

Revision history for this message
Tiffany Little (tslittle) wrote :

Cross-referencing bug 2072587 here because I think my comment (#11) is asking for the same thing as that bug, i.e. archiving/deleting statcats.

Revision history for this message
Steven Mayo (stmayo) wrote (last edit ):

Here's a branch: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/smayo/lp1752367-Edit_And_Delete_Stat_Cat_Entries_fromsql

It reenables edits and deletes of item stat cat entries with no change. (As they already have the desired behavior.)
For patron stat cat entries, it adds a database trigger to change the values 'on patron accounts' when you change or delete entries.
It will only catch direct matches of the entry you're changing from - since patron stat cats can be free text, there may be typos that will stay unchanged.

Note that deleting a patron/item stat cat entry unassigns it from all patrons/items. If you need to correct a poorly named stat cat entry, edit the existing one without deleting it first.

You can also lose information when changing the value of patron stat cat entries; you may change an existing patron stat cat entry to the value of a freetext-only entry and be unable to separate them again.
(You can take advantage of this to clean up typos by repeatedly changing an entry to its typos, and then back to the proper spelling. It's very silly though)

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

We tested this during collaborative code review, and I agree to use my name, redavis/Ruth Frasur Davis, and email address <email address hidden> to sign off.

tags: added: signedoff
removed: needsdiscussion
Revision history for this message
Steven Mayo (stmayo) wrote :

Added a pgtap test to the branch, as suggested during collaborative code review.

Changed in evergreen:
milestone: none → 4.0-beta
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Steven! This is a good approach, and as Ruth said, it worked great in the collaborative code review. Thanks also for the test!

Pushed to main for inclusion in 4.0.

Changed in evergreen:
status: Confirmed → 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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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