Skip to content
Snippets Groups Projects

3404812-typeerror-implode-argument: updated the value being set in...

1 unresolved thread

3404812-typeerror-implode-argument: updated the value being set in #default_value to check if value exists before imploding it or else setting it to NULL

Closes #3404812

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
41 41 $form['not_found_exception_patterns'] = [
42 42 '#type' => 'textarea',
43 43 '#title' => $this->t('Ban URL patterns'),
44 '#default_value' => implode("\n", $config->get('not_found_exception_patterns')),
44 '#default_value' => is_array($config->get('not_found_exception_patterns')) ? implode("\n", $config->get('not_found_exception_patterns')) : NULL,
  • The field is required, so the form would not accept null here. The error happens when a value is given in code, or when the config key is deleted programmatically. This can also break the site if the module is not installed correctly (ex: using a config import). The NULL value is sane, but I wounder, if the config key has a string, would it be better if we show the string? if we don't show it, the site admin who saved a string using drush would think that his value was not saved.

  • Please register or sign in to reply
  • Al-Ayham Saleh added 1 commit

    added 1 commit

    Compare with previous version

  • Al-Ayham Saleh added 2 commits

    added 2 commits

    • e109573a - 1 commit from branch project:3.x
    • 5ab033be - Merge branch perimeter:3.x into 3404812-typeerror-implode-argument

    Compare with previous version

  • Please register or sign in to reply
    Loading