Problem/Motivation

Comment and node links documentation mention drupal_pre_render_links but that function no longer exists.

This should say \Drupal\Core\Render\Element\Link::preRenderLinks() instead.

(It's a total WTF that a #theme links is hacking into a prerender callback for #type links, but out of scope here.)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3436070

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

joachim created an issue. See original summary.

markusvjh’s picture

Hi Joachim, thanks for tagging this in novice. I am working on this today

markusvjh’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems correct. Searched repo for drupal_pre_render_links and these were the only 2 instances.

alexpott’s picture

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

Committed and pushed 61018bfeba to 11.x and 7686fb5a20 to 10.3.x and faf7f1505d to 10.2.x. Thanks!

diff --git a/core/modules/comment/src/CommentLazyBuilders.php b/core/modules/comment/src/CommentLazyBuilders.php
index dd945ca4d5..d553411b9f 100644
--- a/core/modules/comment/src/CommentLazyBuilders.php
+++ b/core/modules/comment/src/CommentLazyBuilders.php
@@ -161,7 +161,9 @@ public function renderLinks($comment_entity_id, $view_mode, $langcode, $is_in_pr
    *   The entity to which the comment is attached.
    *
    * @return array
-   *   An array that can be processed by \Drupal\Core\Render\Element\Link::preRenderLinks().
+   *   An array that can be processed by Link::preRenderLinks().
+   *
+   * @see \Drupal\Core\Render\Element\Link::preRenderLinks()
    */
   protected function buildLinks(CommentInterface $entity, EntityInterface $commented_entity) {
     $links = [];
diff --git a/core/modules/node/src/NodeViewBuilder.php b/core/modules/node/src/NodeViewBuilder.php
index 20e15f4a99..b4ab0b5d0f 100644
--- a/core/modules/node/src/NodeViewBuilder.php
+++ b/core/modules/node/src/NodeViewBuilder.php
@@ -119,7 +119,9 @@ public static function renderLinks($node_entity_id, $view_mode, $langcode, $is_i
    *   A view mode identifier.
    *
    * @return array
-   *   An array that can be processed by \Drupal\Core\Render\Element\Link::preRenderLinks().
+   *   An array that can be processed by Link::preRenderLinks().
+   *
+   * @see \Drupal\Core\Render\Element\Link::preRenderLinks()
    */
   protected static function buildLinks(NodeInterface $entity, $view_mode) {
     $links = [];

Ensured the @return is within the 80 chars limit for comments and added an @see.

  • alexpott committed faf7f150 on 10.2.x
    Issue #3436070 by markusVJH, joachim: obsolete docs about...

  • alexpott committed 7686fb5a on 10.3.x
    Issue #3436070 by markusVJH, joachim: obsolete docs about...

  • alexpott committed 61018bfe on 11.x
    Issue #3436070 by markusVJH, joachim: obsolete docs about...

Status: Fixed » Closed (fixed)

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