Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Current code
function theme_more_help_link($variables) {
return '<div class="more-help-link">' . l(t('More help'), $variables['url']) . '</div>';
}
Render array to replace that:
$more_help_link = array(
'#type' => 'link',
'#href' => 'admin/help/forum',
'#title' => t('More help'),
);
$container = array(
'#theme' => 'container',
'#children' => drupal_render($more_help_link),
'#attributes' => array(
'class' => array('more-help-link'),
),
);
$output = drupal_render($container);
Comment | File | Size | Author |
---|---|---|---|
#4 | 2031305-4.patch | 2.39 KB | thedavidmeister |
#4 | interdiff-1-4.txt | 446 bytes | thedavidmeister |
#1 | core-remove_theme_more_help_link-2031305-1.patch | 2.39 KB | jenlampton |
Comments
Comment #1
jenlamptongiving it a whirl
Comment #2
ericrdb CreditAttribution: ericrdb commentedLooked for the More Help link on the Forum setting page (forum#overlay=admin/structure/forum).
Found it and the link worked.
Comment #3
star-szrExtra space between => and drupal_render().
Otherwise looks good I think :)
Thanks for testing @ericrdb!
Comment #4
thedavidmeister CreditAttribution: thedavidmeister commentedwhitespace fix requested by Cottser.
Comment #5
thedavidmeister CreditAttribution: thedavidmeister commentedwell, RTBC as per #2 and #3.
Comment #6
YesCT CreditAttribution: YesCT commentedThis issue was RTBC and passing tests on July 1, the beginning of API freeze.
Comment #7
catchCommitted/pushed to 8.x, thanks!
Comment #8
jenlamptonfollow-up: #2043649: Make all #type 'link' arrays 100% renderable, use #theme_wrappers if necessary
Comment #9
rabellamy CreditAttribution: rabellamy commentedI am going to write the API change notification.
Comment #10
rabellamy CreditAttribution: rabellamy commentedcore/includes/theme.inc
Before:
After:
core/modules/forum/forum.module
Before:
After:
core/modules/system/css/system.theme.css
Before:
After:
Comment #11
star-szrThat's quite thorough @rabellamy! I'm thinking we should slim it down and focus on what a module or theme developer previously using this theme hook will need to know. If someone wants every last detail they can always come back to this issue, read the comments, and look at the patch.
Here are a couple examples of theme function removal change notices, they are not exactly the same as this case but good to look at to get an idea of what this could look like.
https://drupal.org/node/2019739
https://drupal.org/node/1987618
Thanks for working on this, looking forward to seeing the next draft!
Comment #12
rabellamy CreditAttribution: rabellamy commentedcore/includes/theme.inc
Before (D7)
After (D8)
core/modules/forum/forum.module
Before (D7)
After (D8)
Impacts:
Module developers
Themers
Comment #13
star-szr(This should still be critical since the change notice is not up yet…)
@rabellamy, thanks for your continued work and patience. Can we just boil this down to the before/after of actually using this theme function? The rest is not necessary. Shorter is usually better for change notices :)
So the summary part is fine, you don't really need to say what files were changed though. Here is my suggestion for the change notice based off of your work above, feel free to post this and/or tweak as you see fit:
Summary:
theme_more_help_link() has been removed from core and replaced with a #type link render array. This theme function was only used once in core, in the forum module.
Before (D7):
After (D8):
Comment #14
rabellamy CreditAttribution: rabellamy commentedI have created the change record.
https://drupal.org/node/2076373
Comment #15.0
(not verified) CreditAttribution: commentedcode