molgenis / molgenis-emx2

MOLGENIS EMX2, the latest version of the MOLGENIS data platform.
GNU Lesser General Public License v3.0
11 stars 16 forks source link

fix(explorer): Cannot edit records if key=1 is of datatype int #3877

Closed dtroelofsprins closed 1 week ago

dtroelofsprins commented 2 weeks ago

What version of EMX2 are you using (see footer) v10.81.2

Describe the bug Saved records in tables having key=1 column of datatype=int cannot be edited.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://emx2.dev.molgenis.org'
  2. Create a new testschema
  3. upload the attached file
  4. Goto table TestTable and try to edit the record => an empty popup screen is shown
  5. Console log error is:
    {
    "errors" : [
    {
      "message" : "Exception while fetching data (/TestTable) : Cannot invoke \"org.molgenis.emx2.Filter.getOperator()\" because \"f\" is null"
    }
    ]
    }
  6. Change datatype of id column to string
  7. Goto the TestTable again and edit the record => the data is shown.

Expected behavior Of course not every datatype can be used as PK. I would however expect to be able to at least assign a key=1 to an INT column. Otherwise this should be stated very clear in the manual and the example in the manual should be adjusted, as there the key=1 column is of datatype=int.