Closed yonyitz closed 5 years ago
Please give the specific IDs of the works you were working on. This does work for some works at some times (I just verified it worked for me in a random one on staging), so it may be particular characteristics of the particular works involved that trigger the bug.
Thanks, @jrochkind ! I was working on this record https://digital.sciencehistory.org/works/5d86p139h and was attempting to move filename 2007.509_037 (last image) in numerical order.
Here is another record where the sort function is not working:
This is another record that needs sorting:
So here's my current understanding:
For now, I've sorted 'Polygraphice' and 'Physical apparatus' correctly by filename. The hidden characters are still in there. See e.g. https://staging.digital.sciencehistory.org/concern/file_sets/cc08hg70d and inspect the HTML. Note the title is actually "b1036401_001.tif". As for the Woodward seminar, I'm happy to help sort it; just let me know which pages are out of order.
@yonyitz, if it's OK with you, I'd like to close this ticket, unless we can verify there's another problem not described above. By the way, if we want to remove these weird zero-width no-break spaces from fileset titles, we can totally do that, but that should probably be another ticket.
@eddierubeiz working on the lecture note issue and will be in touch with my findings in case it requires your help. Will be in touch!
Okay; I've figured out that https://digital.sciencehistory.org/works/q237hs87b should follow https://digital.sciencehistory.org/works/v692t719s. The filenames indicate the correct order placement. The titles do not reflect order. The drag/drop sort feature still does not work. Hope that all makes sense!
So there were two things wrong with the Woodward seminar ( the tech notes below are mostly for me and @jrochkind for future reference. )
nil
items.
This resulted in a 500 error getting thrown when you went to https://digital.sciencehistory.org/concern/generic_works/5d86p139h/file_manager , reordered the files by dragging and dropping, and hit "Save".To fix this:
1) I added the wayward child back:
parent = GenericWork.find('5d86p139h')
child = GenericWork.find('q237hs87b')
parent.members << child
parent.ordered_members << child
parent.save!
2) I removed the nil
items from parent.ordered_members
:
parent.ordered_members == parent.ordered_members.to_a.compact
Now we can drag and drop the items around and the results are saved correctly.
To summarize all the notes above, the following problems can cause trouble with sorting child items in Sufia:
nil
items.
When clicking on "File Manager" then "sort alphabetically" and "save," when you return to the record, the changes are not saved. This functionality also does not work when dragging and dropping the image into the correct order and clicking save.
It seems something similar appeared in point #2 of this ticket that was closed: https://github.com/sciencehistory/chf-sufia/issues/896