Allow ConfirmFormInterface::getDescription() to alternatively return a renderable array

Created on 26 September 2015, about 9 years ago
Updated 7 April 2023, over 1 year ago

Problem/Motivation

ConfirmFormInterface::getDescription() is designed to return only translated strings. However, sometime the description gets complex, involving a lot of markup that fits better to a renderable array than a simple string.

Proposed resolution

Alternatively, allow renderable arrays as return for ConfirmFormInterface::getDescription().

Remaining tasks

None.

User interface changes

None.

API changes

Before:

  /**
   * Returns additional text to display as a description.
   *
   * @return string
   *   The form description.
   */
  public function getDescription();

After:

  /**
   * Returns additional text to display as a description.
   *
   * The text can be provided as a translated string or as a renderable array.
   *
   * @return string|array
   *   The form description.
   */
  public function getDescription();

Data model changes

None.

Feature request
Status

Needs work

Version

10.1

Component
Form 

Last updated about 10 hours ago

Created by

🇷🇴Romania claudiu.cristea Arad 🇷🇴

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

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.

Production build 0.71.5 2024