specify / specify7

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

Inconsistent display for -to-many relationship fields in table formats/query combo box #3868

Open grantfitzsimmons opened 1 year ago

grantfitzsimmons commented 1 year ago

Format: Here is the Reference Work format as I have described it in Specify itself:

    <format
        name="ReferenceWork"
        title="ReferenceWork"
        class="edu.ku.brc.specify.datamodel.ReferenceWork"
        default="true"
        >
        <switch single="false" field="referenceWorkType">
            <fields value='0'> <!--Book-->
                <field>authors</field>
                <field sep=", ">workDate</field>
                <field sep=", ">title</field>
                <field sep=", ">placeOfPublication</field>
                <field sep=", ">publisher</field>
            </fields>
            <fields> <!--Anything else-->
                <field>authors</field>
                <field sep=", ">workDate</field>
                <field sep=", ">title</field>
                <field sep=", ">publisher</field>
            </fields>
        </switch>
    </format>

When the Reference Work record is a book (Llibre) it would be formatted as: authors, workDate, title, placeOfPublication, publisher

If it is any other type, it would use the following formatter: authors, workDate, title, publisher

Output: (Shown in Query Builder)

Formatted correctly!

image
López González, Pablo José, 11/2020, A new calcaxonian genus and family for Trichogorgia utinomii Cordeiro, 2019 (Octocorallia, Alcyonacea): new records of a scleriteless gorgonian species from Antarctica

Output: (Shown on form and query combo box) https://mcnb.specifycloud.org/specify/view/referencework/303/

image

image

Oddly enough, when looking up a record, it uses the properly formatted name:

https://github.com/specify/specify7/assets/37256050/65cbc72e-aaf3-49fc-9553-82427c1dae87

But you cannot search on the authors since the TypeSearch definition does not allow for that to happen.

11/2020, A new calcaxonian genus and family for Trichogorgia utinomii Cordeiro, 2019 (Octocorallia, Alcyonacea): new records of a scleriteless gorgonian species from Antarctica

Reported By: MCNB

v7.8.13, mcnb, macOS, Firefox

grantfitzsimmons commented 1 year ago

@realVinayak asked me to try this on v7.9-dev. See below:

image image

The same issue is happening here

melton-jason commented 3 months ago

Describe the bug The desired format of the ReferenceWork field is not respected after the record is added to the citation form. The format displays correctly when searching and in query results, but the field reverts to the default display order after being added to the form. The table formats are set in schema config for CO citation, Taxon citation, and the Reference Works table.

To Reproduce Steps to reproduce the behavior: Test Panel Database: mcnb_7_31_23

  1. Open a new Collection Object or Taxon record
  2. Open the Citation subview (icon on CO and subform on Taxon)
  3. Search in the referencework field (Cita bibliofràfica) and add a citation
  4. Save form
  5. See error in changed formatting of field

Expected behavior referencework field should display according to the defined format on the forms.

Screenshots If applicable, add screenshots to help explain your problem.

format is correct in queries on the Reference Work table: Screenshot 2023-10-04 at 10 18 12 AM

format is correct in queries on the CO table ONLY when (formatted) for CO is mapped to the query as well:

Screen.Recording.2023-10-04.at.11.00.42.AM.mov adding a citation to the form:

Screen.Recording.2023-10-03.at.1.35.49.PM.mov

From https://github.com/specify/specify7/issues/4064#issue-1926573369

bronwyncombs commented 3 months ago

Jordi from MCNB has requested an update on the timeline of resolving this for his database.

emenslin commented 1 month ago

Can recreate in edge (7.9.6)