StoutLogic / acf-builder

An Advanced Custom Field Configuration Builder
GNU General Public License v2.0
792 stars 60 forks source link

Message field not working #124

Closed jnaklaas closed 3 years ago

jnaklaas commented 3 years ago

$field->addMessage('message', ['message'=>'this is the message']); results in an error. The field group is located in a custom gutenberg block. The gutenberg block can't load the acf fields - ajax request results in a 500 error.

Error message: "preg_match_all() expects parameter 2 to be string, array given" file: "/wp/wp-includes/formatting.php", … }

stevep commented 3 years ago

addMessage requires 2 fields. The first one is the label, and the second is the actual message.

https://github.com/StoutLogic/acf-builder/blob/e46d0fb5770c96dbb97c13fc855cfbb88e10aed2/src/FieldsBuilder.php#L551

jnaklaas commented 3 years ago

Thanks @stevep. The Wiki page got me on the wrong foot. The documentation on the Message field type is wrong.