Doublecheck settings being merged

Created on 3 July 2025, 11 days ago

Relocated from #3531327-5: Create new "power user" flag to disable warnings and validation β†’ :

public function settingsForm(array $form, FormStateInterface $form_state): array {
    $this->settings = array_replace_recursive($this->defaultSettings(), $this->settings);

The fact that defaultSettings() are only merged in settingsForm(), and not in the constructor or process(), feels off. That said, it might be 100% valid. I'm thinking that if the filter ever processes text without the form being loaded first, it could result in unexpected behavior? I wonder if it makes more sense to initialize $this->settings in the constructor.

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ultimike Florida, USA

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

Comments & Activities

Production build 0.71.5 2024