When creating a custom field which has quotes, line breaks and likely also some other special characters in the instructions field the export function produces an invalid format and the import for these fields fails.
You can easily test this by adding a testgroup with a text field and enter something like
his is a test instruction with a “quote” and a
line break.
in the instructions field. When you export this group it will produce the following meta value:
<wp:meta_value><![CDATA[a:14:{s:3:"key";s:19:"field_528cba5c76878";s:5:"label";s:10:"test field";s:4:"name";s:10:"test_field";s:4:"type";s:4:"text";s:12:"instructions";s:60:"This is a test instruction with a "quote" and a
line break.";s:8:"required";s:1:"0";s:13:"default_value";s:0:"";s:11:"placeholder";s:0:"";s:7:"prepend";s:0:"";s:6:"append";s:0:"";s:10:"formatting";s:4:"html";s:9:"maxlength";s:0:"";s:17:"conditional_logic";a:3:{s:6:"status";s:1:"0";s:5:"rules";a:1:{i:0;a:2:{s:5:"field";s:4:"null";s:8:"operator";s:2:"==";}}s:8:"allorany";s:3:"all";}s:8:"order_no";i:0;}]]></wp:meta_value>
As you can see the quotes are not correctly escaped. It’s likely necessary to use esc_sql, mysql_real_escape_string or in the worst case even a addslashes on the string that’s being serialized.
Hi @thott
Thanks for the debugging info.
Currently, I know of the line break issue, but I’ll do some testing with quotes too.
This will be fixed in the next version
Thanks
E