collectiveaccess / providence

Cataloguing and data/media management application
GNU General Public License v3.0
303 stars 170 forks source link

Obj. Rep. Editor Pitfall #1374

Open miqrogroove opened 1 year ago

miqrogroove commented 1 year ago

I've noticed there's a use case for the Object Representation editor that can cause a representation to become orphaned in the database.

Steps to reproduce this, based on trying to "move" a representation from one existing object to another.

  1. Click the Relationships tab of the editor.
  2. Remove the current Object.
  3. Click the Add relationship link.
  4. Paste the Obect identifier for the other Obect.
  5. Quickly proceed to click the Save button before the Add relationship menu populates.

Expected result:

Providence should either reject this change, or should prompt "are you sure" before deleting all relationships.

Actual result:

Providence removes the representation from the existing Object, leaving no way to find it in the search engine.

Workaround:

The representation ID number (not the identifier string) of the orphaned representation, if known or located using a SQL command, can then be inserted into the browser address bar (e.g. /editor/object_representations/ObjectRepresentationEditor/Edit/representation_id/{number}) to resume editing and then retry adding a relationship.

Where possible, it may be helpful to look for the orphaned representation in the web browser history.

As a matter of avoidance, it is necessary to ensure that the Related objects box always displays a normal result before clicking the Save button.

collectiveaccess commented 1 year ago

You can also just enable representations as first-class records (set ca_object_representations_disable = 0 in app.conf), at which point they will be orphans no more.

miqrogroove commented 1 year ago

You can also just enable representations as first-class records (set ca_object_representations_disable = 0 in app.conf)

Results were a little confusing. It adds Representation menus to the menu bar, but does not affect Quicksearch results in any way. To search by the original_filename value, I have to use the Find > Representations > Basic search menu. I would consider this a workaround, because it does not prevent the unwanted behavior of the editor, and does not enable Quicksearch. For the same reason, I might also use ca_object_representations_dont_show_in_new_menu = 1.

miqrogroove commented 1 year ago

Unsure if this is a separate issue: Neither the quicksearch nor the Basic search will match original_filename values containing a space char.