Problem/Motivation

\Drupal\ajax_comments\Form\AjaxCommentsDeleteForm::buildForm() contains a workaround for a bug in Drupal Core #2207247: Dialog titles double escaped for views handlers and delete forms

// Workaround for the core issue with markup in dialog titles:
      // https://www.drupal.org/node/2207247
      // Replace the emphasis tags with quote marks.
      $title_args = $form['#title']->getArguments();
      $arg_replacements = [];
      foreach ($title_args as $placeholder => $replacement) {
        if (strpos($placeholder, '%') === 0) {
          $new_placeholder = '@' . substr($placeholder, 1);
          $arg_replacements[$placeholder] = $new_placeholder;
          $title_args[$new_placeholder] = $replacement;
          unset($title_args[$placeholder]);
        }
        else {
          $arg_replacements[$placeholder] = $placeholder;
        }
      }
      $raw_string = $form['#title']->getUntranslatedString();
      $new_string = strtr($raw_string, $arg_replacements);
      $form['#title'] = $this->t($new_string, $title_args);

Proposed resolution

Remove the workaround since the underlying bug was fixed in Drupal Core.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

CommentFileSizeAuthor
#2 3166373-2.patch1.29 KBidebr

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
StatusFileSize
new1.29 KB

Attached patch removes the workaround since the underlying bug was fixed in Drupal Core.

qzmenko’s picture

Assigned: Unassigned » qzmenko

  • qzmenko committed a01caae on 8.x-1.x authored by idebr
    Issue #3166373 by idebr, qzmenko: Remove workaround for double escaped...
qzmenko’s picture

Assigned: qzmenko » Unassigned
Status: Needs review » Fixed

Commited, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.