- Issue created by @purencool
- Merge request !4Code update so the submitForm method can save configuration correctly. → (Open) created by purencool
Children sites input text box submit form won't save configuration `/admin/config/bakery`
namespace Drupal\bakery\Forms;
.....
class BakerySettingsForm {
public function submitForm(array &$form, FormStateInterface $form_state) {
......
if ($children) {
// Transform the text string into an array.
$slaves = explode("\n", trim(str_replace("\r", '', $children)));
// For each entry, remove the trailing slash
// (if present) and concatenate with a new trailing slash.
foreach ($slaves as &$slave) {
$slave = trim($slave, '/') . '/';
}
$config->set('bakery_slave', $slaves); <----- Needs to change to bakery_children
}
else {
$config->set('bakery_slave', []); <----- Needs to change to bakery_children
}
....
}
Needs review
3.0
Code