#suffix & #prefix Not Included in Documentation

Created on 12 August 2017, almost 7 years ago
Updated 14 February 2023, over 1 year ago

Problem/Motivation

API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

Enter a descriptive title (above) relating to abstract class FormElement, then describe the problem you have found:

I noticed that the #prefix and #suffix properties are not included in the documentation.

It could be something like:

  • #prefix: (string) Prefix to display before the form element. Should be translated, normally. If it is not already wrapped in a safe markup object, will be filtered for XSS safety.
  • #field: (string) Suffix to display after the form element. Should be translated, normally. If it is not already wrapped in a safe markup object, will be filtered for XSS safety.

Steps to reproduce

NA

Proposed resolution

Per#11 the original suggestion is covere

These are documented on \Drupal\Core\Render\Element\RenderElement - all the other things there also apply to FormElement and are only documented on RenderElement.

#13 suggests appending some helper text to FormElement.php

Remaining tasks

Code Review

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

πŸ› Bug report
Status

Fixed

Version

10.1 ✨

Component
DocumentationΒ  β†’

Last updated 32 minutes ago

No maintainer
Created by

πŸ‡¨πŸ‡¦Canada Nathan Tsai

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Updated issue summary to the default template to help the committers.

    #20 appears to be doing the proposed solution mentioned in #13

  • Status changed to Needs work over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom catch
    +++ b/core/lib/Drupal/Core/Render/Element/FormElement.php
    @@ -27,7 +27,8 @@
    - * processing of form elements:
    + * processing of form elements, besides those properties documented in RenderElement
    + * (for example: #prefix, #suffix):
      * - #after_build: (array) Array of callables or function names, which are
    

    This is over 80 characters.

    Do we already have an @see RenderElement somewhere else in the docs?

  • Status changed to Needs review over 1 year ago
  • πŸ‡¨πŸ‡³China jungle Chongqing, China

    >This is over 80 characters.

    Addressed.

    > Do we already have an @see RenderElement somewhere else in the docs?

    No. Added one.

  • Status changed to RTBC over 1 year ago
  • πŸ‡¨πŸ‡³China jungle Chongqing, China

    I know self-RTBCing is not allowed, but I think it's fine here.

    • catch β†’ committed d4228ec1 on 10.1.x
      Issue #2901803 by jungle, ankithashetty, anisha.challa, hmendes, Nathan...
  • Status changed to Fixed over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    OK I think the for example and the @see addresses @alexpott's original concern with the patch.

    Committed/pushed to 10.1.x, thanks!

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

Production build 0.69.0 2024