Support › MB Frontend Submission › Fatal error caused by changing taxonomy field types
I don't know if this is posted about or known.
But today I ran into a confusing issue where submitting certain posts (via Frontend Submission, boxes built with MB Builder) was causing a fatal error:
PHP Fatal error: Uncaught TypeError: urlencode(): Argument #1 ($string) must be of type string, array given in /home/.../wp-includes/formatting.php:5663
After tracking it down to a Taxonomy field, I simply changed the field ID (since this isn't saved for a tax field) and everything worked again.
It turns out, earlier I had experimented using a different format (select) and changed it (to checkbox tree) for that field.
It was the posts which I had saved using the previous taxonomy-field-format (ie. select field).
I'm guessing the field settings get cached somewhere? And caused invalid submission via the frontend form...
Hopefully it will make sense to you, I'm just reporting it because it was a nightmare.
And in case anyone has this issue, tldr; just change the name of your taxonomy field.
Please export the field group to a JSON file, share it here and let me know how to reproduce the issue. I will check this on my demo site and escalate it to the development team if it is a bug.
Follow the documentation to export the field group https://docs.metabox.io/extensions/meta-box-builder/#export--import