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

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

Status: Active » Needs review
StatusFileSize
new880 bytes
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

@hussainweb,
Thanks for pointing out the issue. Fixing in updated patch.

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

StatusFileSize
new884 bytes
new531 bytes

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.

ankit agrawal’s picture

StatusFileSize
new907 bytes
new41.93 KB

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.