upenndigitalscholarship / deep

MIT License
3 stars 1 forks source link

"In collection:" not displaying quite right #198

Closed ZacharyLesser closed 3 months ago

ZacharyLesser commented 5 months ago
Screenshot 2024-01-23 at 3 20 29 PM

Right now, after "In Collection" it displays the Title - Title

Instead, it should display the Item - Item Specific Title, and then in parentheses the Item - Year (of Publication). You can see how we'd like it to appear on the screen shot from the old site.

Screenshot 2024-01-23 at 3 20 57 PM
ZacharyLesser commented 4 months ago

Like #201 there is a problem with the In Collection data field -- it does not automatically update the titles and for any titles that we have changed, there are now 2 versions available in the In Collection field, the old (wrong) one and the new (correct) one. Both have the same DEEP # and seem to link to the same (correct) record on the user side.

ZacharyLesser commented 4 months ago

This is functioning correctly now on the user side.

There are still 2 versions of each Collection title available in the "In Collection" field at the Item level. Test with the Item with DEEP # 5144.03 -- if you scroll down to In Collection, you'll see 5144 listed (correctly). But if you try to change that, and start typing 5144, you'll see the correct version but also the old version of the title of this Collection.

Is this a problem, even though it doesn't show up on the user side at all? There is a "ghost" version of each Collection title that we have changed.

apjanco commented 3 months ago

Retire the Link object in the db

apjanco commented 3 months ago

The issue here is a result of the database architecture. variant_links, in_collection, collection_contains, and independent_playbook_link relate to an object called Link. This was necessary because Items cannot relate to other Items in the same table. The problem is that Link objects are independent of the Items. The Item save method updates or creates the corresponding Link. That is working properly based on deep_id and title and greg. However, when the title is changed, it triggers create rather than get. Need to update save().

apjanco commented 3 months ago

There are 200 Links that share the same deep_id, but have different titles. I can remove the duplicates, but I need to update any Items that relate to that object and relate them to the most recent Link (using pk) before deleting the link. I should backup the data before doing this.