Tokens in the custom error message

Created on 23 October 2017, about 7 years ago
Updated 4 May 2023, over 1 year ago

The "Custom error message" field does not seem to support tokens.

πŸ› Bug report
Status

Closed: won't fix

Version

2.6

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia sano

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

Comments & Activities

Not all content is available!

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

  • πŸ‡¨πŸ‡³China g089h515r806

    it is supported in set_error method.

      public function set_error($tokens = array()) {
        $error_element = $this->get_error_element();
        $error_message = t($this->get_error_message());
        $tokens += array(
          '[entity-type]' => $this->rule->entity_type, 
          '[bundle]' => $this->rule->bundle, 
          '[field-name]' => $this->instance['label'], 
          '[value]' => $this->value, 
        );
        $error_message = field_filter_xss(strtr($error_message, $tokens));
    
Production build 0.71.5 2024