verbb / tablemaker

A user-definable table field type for Craft CMS
MIT License
40 stars 32 forks source link

Removing default row/header creates a GQL exception #35

Closed TGriffiths88 closed 1 year ago

TGriffiths88 commented 1 year ago

Describe the bug

If you remove the default row and header from the field and save the entry, it saves the values as null. Which is probably correct. However, when querying against the data with GQL it throws an exception.

See below:

 "errors": [
    {
      "message": "Something went wrong when processing the GraphQL query.",
      "extensions": {
        "category": "graphql"
      }
    },
    {
      "message": "Something went wrong when processing the GraphQL query.",
      "extensions": {
        "category": "graphql"
      }
    }
  ],

If I re-open the entry, touch one of the table fields and resave, it then clears the error. Presumably because the values are no longer null.

Steps to reproduce

  1. Add a tablemaker field to an entry
  2. Remove the default row
  3. Save the entry
  4. Query that entry in GQL
  5. Exception is thrown

Craft CMS version

Craft Pro 4.3.10

Plugin version

4.0.4

Multi-site?

Yes

Additional context

In my install we have the table maker field within a child block in Neo

engram-design commented 1 year ago

Should be fixed in 4.0.5

TGriffiths88 commented 1 year ago

Thanks @engram-design for the speedy fix there. Much appreciated.

TGriffiths88 commented 1 year ago

@engram-design I just updated to 4.0.5 and tested this out. It's resolved the issue with rows but columns are still causing an error. Sorry, perhaps I didn't make that clear on the original post. See below:

"errors": [
    {
      "message": "Something went wrong when processing the GraphQL query.",
      "extensions": {
        "category": "graphql"
      }
    }
  ]
engram-design commented 1 year ago

Good call. Updated in 4.0.6