Webform 8.x-5.0-RC3 can't set custom settings Here is my problem. I have a drupal website I'm working on where I've got webform with custom settings (such as checklist with custom elements and some others). I was on 5.0-beta24 and everything was fine. I saw that an update to the RC3 was available so I tried to see if there was any breaking change. And it seems that my custom settings are no longer saved. 

What is the breaking change, and is there a solution so I can still define my custom settings / another way to do it ? 

You can find below my current function to alter the settings form and add my custom's one.

&lt;?php
function mymodule__form_webform_settings_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {

  $settings = $form_state-&gt;getFormObject()-&gt;getEntity()-&gt;getSettings();

  $form['general_settings']['description']['#title'] = t("Subtitle");
  $form['general_settings']['description']['#type'] = 'textfield';

  $form['form_settings_categories'] = [
    '#type' =&gt; 'details',
    '#title' =&gt; 'Catégories',
    '#open' =&gt; TRUE,
    '#input' =&gt; FALSE,
  ];

  $form['form_settings_categories']['categories'] = [
    '#type' =&gt; 'checkboxes',
    '#options' =&gt; \Drupal\avantages\Services\PopulationsService::getPopulationList(),
    '#title' =&gt; t('Catégories'),
    '#default_value' =&gt; $settings['categories'] ?? ['test'],
    '#required' =&gt; FALSE,
  ];

}


Edit : 

After some research, it seems (but I can be wrong) that the line that cause trouble is this one

  /**
   * {@inheritdoc}
   */
  public function setSettings(array $settings) {
    // Always apply the default settings.
    $this-&gt;settings += static::getDefaultSettings();
    // Now apply new settings.
    foreach ($settings as $name =&gt; $value) {
    if (array_key_exists($name, $this-&gt;settings)) {
      $this-&gt;settings[$name] = $value;
    }
  }

  return $this;
}


As my custom setting is not is getDefaultSettings, I can't save it. 

Is there any new way to save custom settings ? 

Thanks
Finally, I found the answer. Webform implement ThirdPartySettingsInterface so I can edit my form_alter function to do the following : 

// Because hidden by default.
$form["third_party_settings"]["#access"] = true; 
$form['third_party_settings']['quizzes']['details_categories'] = [
    '#type' =&gt; 'details',
    '#title' =&gt; 'Catégories',
    '#open' =&gt; true,
    '#input' =&gt; false,
  ];

  $form['third_party_settings']['quizzes']['details_categories']['categories'] = [
    '#type' =&gt; 'checkboxes',
    '#options' =&gt; \Drupal\avantages\Services\PopulationsService::getPopulationList(),
    '#title' =&gt; t('Catégories'),
    '#default_value' =&gt; "",
    '#required' =&gt; false,
  ];


And to access my data, within the Webform entity : 

$webform-&gt;getThirdPartySetting("quizzes", "categories");