Closed giorgiopogliani closed 1 year ago
Fixed for the next release. To get this early, change your verbb/formie
requirement in composer.json
to:
"require": {
"verbb/formie": "dev-craft-3 as 1.6.14",
"...": "..."
}
Then run composer update
.
Hello @engram-design, I did what you said but I still have the same error PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x94\xBA",...' for column 'cache' ...
.
I updated the composer.json
as you said and run composer update
and tried the integration again, but nothing changed apparently.
Have you refreshed the integration after the update?
Yes, that's the moment where it gives error. I also tried to disconnect and reconnect but didn't help
Is it that exact same error? Support should allow for any label of a custom field to contain an emoji now. Your original example showed Example Label 🔺
which I'll assume is a custom field in your Salesforce account. This does seem to work for me.
Yeah same error, although there are other emojis scattered in the json and in different locations, that was an example. Do you require every use case? I see also emojis in the options of some fields, could this help?
I'll require every use-case, yes - because we need to add specific handling for it. Option labels are a good point though, which I've just pushed an additional fix for (run composer update
again).
Fixed in 1.6.15
@engram-design I tried to update but the issue is still present. Did you also "escape" labels for options of options? This is another example:
{\"class\":\"verbb\\\\formie\\\\models\\\\IntegrationField\",\"handle\":\"Test__c\",\"type\":\"string\",\"required\":false,\"options\":{\"label\":\"Test\",\"options\":[{\"label\":\"🟢\",\"value\":\"Good\"},{\"label\":\"🟡\",\"value\":\"Okay\"},{\"label\":\"🔴\",\"value\":\"Bad\"}]}
Yeah, everything is escaped now, the entire string that's saved to the database is checked for emoji's and replaced. I did also check option labels just to be sure, but I can't seem to replicate that (I have a picklist field in Salesforce, which I believe is the same as your Test__c
field)
@engram-design I checked the failed query again and I found this part:
{\"label\":\"🟢\",\"value\":\"Good\"},{\"label\":\"🟡\",\"value\":\"Okay\"},{\"label\":\":red_circle:\",\"value\":\"Bad\"}
It looks like the red circle got escaped but not the others.
Looks like this is actually down to the litemoji library (that both Craft and Formie use) not supporting these emoji's altogether. I've filed an issue there.
FYI, this will be fixed in Craft 4.4 https://github.com/craftcms/cms/discussions/12226
I am on Craft 4.4 and I used an emoji in an error message. Which also resulted in a DB error. I will open a dedicated ticket, soon. Just wanted to mention :)
If you can let me know which emoji's you're using as well? The issue was that some emoji support was missing.
Oh, I'm sorry for that. I'm in a MAC and used the smiley emoji from the emoji menu that you can toggle with the function key. This one to be precise 🙂
Does that help?
That should certainly be supported! Which field are you setting this on, and for which integration?
Ah, my apologies - you mentioned in the error message. Messages aren't supported yet.
I thought so. To not steal your time, I'll post a proper Ticket for you and link it to this one.
Describe the bug
The error is probably due to some emojis in the labels fields of Salesforce and so saving the fields in the cache column fail. The content of the column is something like this:
Steps to reproduce
Form settings
Basic form settings with a salesforce integration under integrations.
Craft CMS version
3.7.43
Plugin version
1.6.14
Multi-site?
No response
Additional context
No response