Problem/Motivation

Remove @todo tags for code examples at functions hook_theme_suggestions_HOOK_alter() and function hook_theme_suggestions_HOOK() in file Theme.api.php

Proposed resolution

Remaining tasks

User interface changes

none

API changes

Documentation only

Data model changes

none

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mac_Weber created an issue. See original summary.

Mac_Weber’s picture

Title: Add code example for function hook_theme_suggestions_HOOK() » Add code example for function hook_theme_suggestions_HOOK_alter()

bad title due to issue clone

mohit_aghera’s picture

hussainweb’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Render/theme.api.php
@@ -711,6 +710,11 @@ function hook_theme_suggestions_HOOK_alter(array &$suggestions, array $variables
+  return $suggestions;

You don't need to return $suggestions. See bartik_theme_suggestions_form_alter for an example.

mohit_aghera’s picture

mohit_aghera’s picture

Status: Needs work » Needs review
hussainweb’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Render/theme.api.php
@@ -696,7 +696,6 @@ function hook_theme_suggestions_alter(array &$suggestions, array $variables, $ho
  *
- * @todo Add @code sample.

Extra line. You should remove the extra blank line so that there is just one blank line before @param.

Ankit Agrawal’s picture

Updated the code. Please check.

mohit_aghera’s picture

Status: Needs work » Needs review
Mac_Weber’s picture

Title: Add code example for function hook_theme_suggestions_HOOK_alter() » Remove @todo tags at functions hook_theme_suggestions_HOOK() and hook_theme_suggestions_HOOK_alter() in file Theme.api.php
Issue summary: View changes
Status: Needs review » Needs work

I've created this issue while testing a new tool to post using the D.O API.
Actually, we already have code example there and I think we don't need anything more complex than what is already there.

We just need to remove the @todo tags.

star-szr’s picture

Ankit Agrawal’s picture

Removed the @todo tags from hook_theme_suggestions[_HOOK]() and hook_theme_suggestions[_HOOK]_alter().

Ankit Agrawal’s picture

Status: Needs work » Needs review
joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @Ankit Agrawal

Mac_Weber’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

This issue is a duplicate of #2111079: Add @code sample and test coverage per hook_theme_suggestions[_HOOK]() and hook_theme_suggestions[_HOOK]_alter()
Closing this one in favor of the other because we already have patches there covering more stuff and also it replaces the tags by code in the documentation.