Closed (fixed)
Project:
htmLawed
Version:
8.x-3.0
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
17 Oct 2016 at 10:07 UTC
Updated:
19 Oct 2016 at 00:06 UTC
Jump to comment: Most recent
When configuring the text filters for a given text format (e.g. /admin/config/content/formats/manage/full_html), the module causes a notice due to using an invalid placeholder in !Help. The available placeholders are described in FormattableMarkup::placeholderFormat.
User error: Invalid placeholder (!Help) in string: !Help in Drupal\Component\Render\FormattableMarkup::placeholderFormat() (line 235 of core/lib/Drupal/Component/Render/FormattableMarkup.php).
Drupal\Component\Render\FormattableMarkup::placeholderFormat('!Help', Array) (Line: 204)
...
Current code:
$form['config'] = array(
'#prefix' => t('!Help', array('!Help' => \Drupal::l('Help', Url::fromUri('base:admin/help/htmlawed')))),
'#type' => 'textarea',
'#rows' => '2',
'#title' => $this->t('Config.'),
'#default_value' => $htmLawed_settings['config'],
'#description' => $this->t("Comma-separated, quoted key-value pairs that will be used for htmLawed's %config parameter", array('%config' => 'config')),
);
Suggested change:
$form['config'] = array(
'#prefix' => t('<a href=":url">Help</a>', array(':url' => Url::fromUri('base:admin/help/htmlawed')->toString())),
'#type' => 'textarea',
'#rows' => '2',
'#title' => $this->t('Config.'),
'#default_value' => $htmLawed_settings['config'],
'#description' => $this->t("Comma-separated, quoted key-value pairs that will be used for htmLawed's %config parameter", array('%config' => 'config')),
);
Comments
Comment #2
alpha2zee commentedThank you for picking this bug and suggesting the fix, which works. I am releasing a new version of the module with this fix.
Comment #3
alpha2zee commented