Problem it ö, ä, ü on MySQL

Hi

Probably found a bug:

If using a MySQL - DB with german ö, ä, ü API Docs gave this error:

“The Response content must be a string or object implementing __toString(), “boolean” given.”

Example:
Zürich >>> Error
Zuerich >>> OK

MySQL - DB is set to UTF-8.

Thanks. I will test this and file a bug report. What version of DreamFactory are you running, and what operating system?

Bug appears on V. 2.0.1.
I tested on Bitnami VMWare - Version and on Dreamfactory Enterprise Instance.
Probably caused by Laravel…

Thank you. I’ll take a look and update you.

Can you provide the following.
What is the collation for your database? Provide the table and field collations as well if they are different.
Provide the schema dump from dreamfactory for this table
GET /{service_name}/_schema/{table_name}
How (through what tool/interface) was the data originally entered into the table?

I just created a fresh DB / Table with some demo data.
Column with ID 1 works, Column with ID 2 causes problems…

SQL - File for import (MySQL):

CREATE TABLE IF NOT EXISTS test (
ID int(11) NOT NULL,
Test1 varchar(200) NOT NULL,
Test2 longtext NOT NULL,
Test3 text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO test (ID, Test1, Test2, Test3) VALUES
(1, ‘demotest’, ‘Some really long text for testing…’, ‘Other text’),
(2, ‘Zürich’, ‘Zürich in Switzerland’, ‘Zürich also in CH’);

This is schema dump:

{
“name”: “test”,
“is_view”: false,
“label”: “Test”,
“plural”: “Tests”,
“description”: null,
“alias”: null,
“field”: [
{
“name”: “ID”,
“label”: “ID”,
“description”: null,
“type”: “integer”,
“db_type”: “int(11)”,
“length”: 11,
“precision”: null,
“scale”: null,
“default”: null,
“required”: true,
“allow_null”: false,
“fixed_length”: false,
“supports_multibyte”: false,
“auto_increment”: false,
“is_primary_key”: false,
“is_foreign_key”: false,
“is_unique”: false,
“is_index”: false,
“ref_table”: null,
“ref_fields”: null,
“picklist”: null,
“validation”: null,
“alias”: null
},
{
“name”: “Test1”,
“label”: “Test1”,
“description”: null,
“type”: “string”,
“db_type”: “varchar(200)”,
“length”: 200,
“precision”: null,
“scale”: null,
“default”: null,
“required”: true,
“allow_null”: false,
“fixed_length”: false,
“supports_multibyte”: true,
“auto_increment”: false,
“is_primary_key”: false,
“is_foreign_key”: false,
“is_unique”: false,
“is_index”: false,
“ref_table”: null,
“ref_fields”: null,
“picklist”: null,
“validation”: null,
“alias”: null
},
{
“name”: “Test2”,
“label”: “Test2”,
“description”: null,
“type”: “text”,
“db_type”: “longtext”,
“length”: null,
“precision”: null,
“scale”: null,
“default”: null,
“required”: true,
“allow_null”: false,
“fixed_length”: false,
“supports_multibyte”: true,
“auto_increment”: false,
“is_primary_key”: false,
“is_foreign_key”: false,
“is_unique”: false,
“is_index”: false,
“ref_table”: null,
“ref_fields”: null,
“picklist”: null,
“validation”: null,
“alias”: null
},
{
“name”: “Test3”,
“label”: “Test3”,
“description”: null,
“type”: “text”,
“db_type”: “text”,
“length”: null,
“precision”: null,
“scale”: null,
“default”: null,
“required”: true,
“allow_null”: false,
“fixed_length”: false,
“supports_multibyte”: true,
“auto_increment”: false,
“is_primary_key”: false,
“is_foreign_key”: false,
“is_unique”: false,
“is_index”: false,
“ref_table”: null,
“ref_fields”: null,
“picklist”: null,
“validation”: null,
“alias”: null
}
],
“related”: [],
“primary_key”: null,
“name_field”: null,
“access”: 31
}

Thank you @pitw. I confirmed the behavior and filed this as a bug yesterday.

Hello @formerstaff! , I am also facing the same issue…if it helps, I also noticed that if you try to set a service (admin/data/Select DB Service) on a table that contains extended characters it will show a popup giving the same error:
“DreamFactory Table Module
The Response content must be a string or object implementing __toString(), “boolean” given.”

And on Swagger if you get the records using application/xml instead of application/json, it will retreive all records that does NOT contain extended characters…the ones that contains , it will return just the tags with an empty field.
example below ( “<” replaced by “[” so it shows here )

[?xml version=“1.0” ?>
[dfapi>
[resource>
[razao_social_cliente>[/razao_social_cliente>
[cidade_cliente>[/cidade_cliente>
[nome_fantasia_cliente>EVENTOS CANTALOUP [/nome_fantasia_cliente>
[/resource>
[/dfapi>""

Looking forward to a fix :smile:
thank you !

Still working on this but wanted to let you know if you create the records using the API they are stored and retrieved with no problem. It’s only existing data.

I have been able to resolve this by adding a charset parameter to the connection string. for mysql this means

mysql:host=localhost;port=3306;dbname=mydb;charset=utf8

1 Like

Thank you! This saved it for me :slight_smile:

1 Like