Commit 7c4076e0 authored by Jacob Rockowitz's avatar Jacob Rockowitz
Browse files

Issue #3266907 by jrockowitz, Mschudders: Allow token replacement in Markup

parent 6107d80a
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -783,6 +783,11 @@ class WebformElementBase extends PluginBase implements WebformElementInterface,
    $this->setElementDefaultCallback($element, 'element_validate');
    $this->prepareElementValidateCallbacks($element, $webform_submission);

    // Replace tokens for all properties.
    if ($webform_submission) {
      $this->replaceTokens($element, $webform_submission);
    }

    if ($this->isInput($element)) {
      // Handle #readonly support.
      // @see \Drupal\Core\Form\FormBuilder::handleInputElement
@@ -808,11 +813,6 @@ class WebformElementBase extends PluginBase implements WebformElementInterface,
      }
    }

    // Replace tokens for all properties.
    if ($webform_submission) {
      $this->replaceTokens($element, $webform_submission);
    }

    // Check markup properties after token replacement just-in-case markup
    // is empty.
    $markup_properties = [
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Render\Markup;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;