I updated a Craft 2.6 installation to the latest 2.6.x and suddenly I get an error when saving a user's profile on the frond end:

mb_detect_encoding() expects parameter 1 to be string, array given

However, nowhere on that page has an emoji been inserted in any input fields or anything.

I hope somebody can help me with this as it is an urgent issue.


I just tracked down the problem to this input field:

<input type="hidden" name="fields[gdprPermissionsList][permissionSales][type]" value="permissionInfo">

Which is quite weird as it does the exact same thing as 3 other fields on that page which work fine.


Solved it. The problem was with this field:

<input type="hidden" name="fields[gdprPermissionsList][permissionSales][fields][lastChangedDate][date]" value="{{ now|date("m/d/Y") }}">

The [date] part was to much and it saved the value in Craft as a literal string: {"date":"07\/11\/2018"} instead of the formatted date.

In one of the Craft updates that throws an error, maybe because it ses it as an object/array due to the curly brackets or maybe because that string has an emoji shortcut in it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.