budibase icon indicating copy to clipboard operation
budibase copied to clipboard

Changing Option Field in Data Interface Causes Boolean ValidationError MariaDB

Open Stropdasman opened this issue 10 months ago • 4 comments

Checklist

  • [X] I have searched budibase discussions and github issues to check if my issue already exists

Hosting

  • Self
    • Method: docker compose
    • Budibase Version: v2.22.3
    • App Version: v2.22.3

Describe the bug Boolean value gives the following error when attempting to change option field in data interface

{
    "message": "Bad Request",
    "status": 400,
    "validationErrors": {
        "assigned": [
            "must be of type boolean"
        ]
    }
}

Desktop (please complete the following information):

  • OS: WINDOWS 11
  • Browser: Chrome
  • Version Versie 122.0.6261.129

https://github.com/Budibase/budibase/assets/147417929/9132b651-4685-44b3-8480-4723c3fd93c1

Stropdasman avatar Mar 28 '24 16:03 Stropdasman

Hey @Stropdasman,

Can you provide your table create script I wasn't able to replicate this behaviour. What happens if you un-check and re-check the boolean field?

ConorWebb96 avatar Apr 03 '24 07:04 ConorWebb96

Hi @ConorWebb96

This is the create table script.

CREATE TABLE `transport_request` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` text NOT NULL,
  `created` datetime NOT NULL,
  `last_modified` datetime NOT NULL,
  `status` text NOT NULL,
  `assigned_transport` int(11) DEFAULT NULL,
  `departure` text NOT NULL,
  `destination` text NOT NULL,
  `item_type` text NOT NULL,
  `amount` text NOT NULL,
  `requested_delivery_date` date DEFAULT NULL,
  `delivery_asap` tinyint(1) DEFAULT NULL,
  `assigned` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

When i check it and uncheck it, it works.

Stropdasman avatar Apr 03 '24 07:04 Stropdasman

Thanks very much for the above schema,

This seems to be MariaDB specific. It is a valid bug, but my advice going forward is to always make sure a value for your bool fields is set before creating/amending records.

ConorWebb96 avatar Apr 05 '24 10:04 ConorWebb96