Errors if not active or empty

Created on 12 July 2022, over 2 years ago
Updated 25 September 2024, about 2 months ago

On /admin/config/content/formats/manage/basic_html if not active module

Warning: Undefined array key "ckeditor_pattern_replace" in Drupal\ckeditor_pattern_replace\Plugin\Filter\CkeditorPatternReplace->settingsForm() (line 43 of modules/ckeditor_pattern_replace/src/Plugin/Filter/CkeditorPatternReplace.php).

If active and empty

The website encountered an unexpected error. Please try again later.
ParseError: syntax error, unexpected token "if" in Composer\Autoload\includeFile() (line 28 of modules/~editor-comment-filter/ckeditor_pattern_replace/src/Plugin/Filter/CkeditorPatternReplace.php).

  public function settingsForm(array $form, FormStateInterface $form_state) {
    $form['ckeditor_pattern_replace'] = [
      '#type' => 'textarea',
      '#title' => $this->t('Add replacement patterns'),
/*WT-patch: err on config if empty*/
      '#default_value' => $this->settings['ckeditor_pattern_replace'] ?? FALSE, //$this->settings['ckeditor_pattern_replace'],
/*<<<*/
      '#placeholder' => $this->t('/RegularExpression/|Replacement'),
  public function process($text, $langcode) {
/*WT-patch: err on config if empty*/
    $ckeditor_pattern_replace = $this->settings['ckeditor_pattern_replace'] ?? FALSE; //$this->settings['ckeditor_pattern_replace']
/*<<<*/
    if (isset($ckeditor_pattern_replace)) {
๐Ÿ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024