Problem/Motivation

In https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co... L300 there is a spelling error in a comment which refers to $add_ellipses - the correct variable to reference should be $add_ellipsis.

   * @param int $min_wordsafe_length
   *   If $wordsafe is TRUE, the minimum acceptable length for truncation (before
   *   adding an ellipsis, if $add_ellipsis is TRUE). Has no effect if $wordsafe
   *   is FALSE. This can be used to prevent having a very short resulting string
   *   that will not be understandable. For instance, if you are truncating the
   *   string "See myverylongurlexample.com for more information" to a word-safe
   *   return length of 20, the only available word boundary within 20 characters
   *   is after the word "See", which wouldn't leave a very informative string. If
   *   you had set $min_wordsafe_length to 10, though, the function would realise
   *   that "See" alone is too short, and would then just truncate ignoring word
   *   boundaries, giving you "See myverylongurl..." (assuming you had set
   *   $add_ellipses to TRUE).

Proposed resolution

Change $add_ellipses to $add_ellipsis

CommentFileSizeAuthor
#2 3368664-2.patch608 bytes_pratik_

Issue fork drupal-3368664

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

keelanfh created an issue. See original summary.

_pratik_’s picture

StatusFileSize
new608 bytes
cilefen’s picture

Status: Active » Reviewed & tested by the community
Issue tags: -comment
longwave’s picture

Status: Reviewed & tested by the community » Needs work

Patch appears to be rolled from the wrong directory.

rpayanm made their first commit to this issue’s fork.

rpayanm’s picture

Status: Needs work » Needs review

Please review.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Reroll was good

quietone’s picture

Title: Spelling error in comment - $add_ellipses » Fix spelling of $add_ellipses is comment.

While add_ellipses is a word it is not the name of the variable. The variable uses the singular form.

  • quietone committed 9f45ca31 on 11.x
    Issue #3368664 by rpayanm, _pratik_, keelanfh, cilefen, longwave,...

  • quietone committed 42002558 on 10.1.x
    Issue #3368664 by rpayanm, _pratik_, keelanfh, cilefen, longwave,...
quietone’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 10.1.x, thanks!

Status: Fixed » Closed (fixed)

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