Skip to content

Query engine renders catalog number "" as "0" for CatalogNumberNumeric formatter #1710

@benanhalt

Description

@benanhalt

This is a backend bug.

$ curl 'http://localhost:8000/stored_query/ephemeral/' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0' -H 'Accept: application/json' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://localhost:8000/specify/query/3/' -H 'Content-Type: application/json' -H 'X-CSRFToken: dM8uDEoLbw8OTs3odILXHLA9kX3fe3fOZsv1Dwe2cSoLhUoe0qkjdYuVTWlGgfDT' -H 'Origin: http://localhost:8000' -H 'Connection: keep-alive' -H 'Cookie: csrftoken=dM8uDEoLbw8OTs3odILXHLA9kX3fe3fOZsv1Dwe2cSoLhUoe0qkjdYuVTWlGgfDT; collection=4; language=en-us; sessionid=6ezlay4vrlg1mhlh2xd7g40ps31jfjtp' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-raw '{"id":3,"contextname":"CollectionObject","contexttableid":1,"countonly":false,"formatauditrecids":false,"isfavorite":true,"name":"Number Tags Query","ordinal":0,"remarks":null,"searchsynonymy":false,"selectdistinct":false,"smushed":false,"sqlstr":null,"timestampcreated":"2012-10-22T10:17:29","timestampmodified":"2012-10-22T10:17:29","version":5,"createdbyagent":"/api/specify/agent/1514/","modifiedbyagent":null,"specifyuser":"/api/specify/specifyuser/2/","reports":"/api/specify/spreport/?query=3","resource_uri":"/api/specify/spquery/3/","fields":[{"tablelist":"1","stringid":"1.collectionobject.catalogNumber","fieldname":"catalogNumber","isrelfld":false,"sorttype":1,"position":0,"isdisplay":true,"operstart":8,"startvalue":"","isnot":false}],"limit":40,"offset":0}'
{"results": [[5327, "0"], [6846, "1"],

Versus

$ curl 'http://localhost:8000/api/specify/collectionobject/5327/' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0' -H 'Accept: application/json' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://localhost:8000/specify/view/collectionobject/5327/' -H 'Content-Type: undefined' -H 'Connection: keep-alive' -H 'Cookie: csrftoken=dM8uDEoLbw8OTs3odILXHLA9kX3fe3fOZsv1Dwe2cSoLhUoe0qkjdYuVTWlGgfDT; collection=4; language=en-us; sessionid=6ezlay4vrlg1mhlh2xd7g40ps31jfjtp' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache'
{"id": 5327, "altcatalognumber": null, "availability": null, "catalognumber": "", "catalogeddate": "2012-03-30",

Metadata

Metadata

Assignees

Labels

1 - BugIncorrect behavior of the product2 - QueriesIssues that are related to the query builder or queries in generaltodo:verifyNeeds Verification

Type

No type

Projects

Status

📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions