specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
60 stars 36 forks source link

`View definition model does not match resource model` when opening attachment preview #3988

Open grantfitzsimmons opened 12 months ago

grantfitzsimmons commented 12 months ago

v7.9, warning shows in console when on the test panel, shows in a toast when using localhost, presumably due to SP7_DEBUG=true in the environment.

https://sbnature9523-v79-dev.test.specifysystems.org/specify/attachments/:

image

Specify 7 Crash Report - 2023-09-07T23 21 20.242Z.txt

localhost:

image

Attachment in question: 1_Zhoud0k2og_RhM34wqFy8w

maxpatiiuk commented 12 months ago

@grantfitzsimmons SP7_DEBUG=true is a back-end only - does not affect front-end at all!

see my earlier comment - https://github.com/specify/specify7/pull/3682#discussion_r1243108276

maxpatiiuk commented 12 months ago

The warning in particular happens if for example you try to display a Determination using the Collection Object form

In this case it's likely trying to display CollectionObjectAttachment using ObjectAttachment form or the other way around

TODO:

  1. Even though we had this warning in specify since forever, I am pretty sure it wasn't triggered in this place before - something in the code might have fixing it (i.e retrieving CollectionObjectAttachment form and them changing table name to ObjectAttachment) - see why it's not working anymore
  2. Check if the thing the warning is warning about is harmful or not in this case (i.e does CollectionObjectAttachment form normally refer to fields via the attachment.* relationship, or to directly as if it is ObjectAttachment? - see how it works in sp6)
    • This would also affect the Form Editor
grantfitzsimmons commented 12 months ago

thank you @maxpatiiuk <3