InvalidArgumentException: Placeholders must have a trailing [] if they are to be expanded with an array of values.

This error can occur when programmatically saving entities. You probably saved a value in a wrong format.

$node->set('field_vacancy_location', ['value' => $location, 'format' => 'full_html']);

In the above example I wrongly saved a full_html format to a regular textfield and got the error. 

$node->set('field_vacancy_location', $location);

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!