Alter bakery_children to bakery_slaves in submitForm method

Created on 12 May 2025, 5 days ago

Problem/Motivation

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
    }
....
}
🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇦🇺Australia purencool

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024