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.
Follow up from #2376147: Installer is missing all of the global Seven theme stylesheets
function seven_preprocess_html(&$variables) {
// Add information about the number of sidebars.
if (!empty($variables['page']['sidebar_first'])) {
$variables['attributes']['class'][] = 'one-sidebar';
$variables['attributes']['class'][] = 'sidebar-first';
}
else {
$variables['attributes']['class'][] = 'no-sidebars';
}
The classes this adds are completely unused. Dead code.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2377393.1.patch | 818 bytes | alexpott |
Comments
Comment #1
alexpottComment #2
alexpottComment #3
sqndr CreditAttribution: sqndr commentedYep, that's true. These classes can be removed. While we're working in the preprocess function, it seems like the code below contains some more issues:
node-layout
, while thenode-form-layout
class is added.@deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.0.
node-edit-form.html.twig
template form the node module and add the class there?Comment #4
alexpott@sqndr this issue is only about removing unused classes - your recommendations look sound but out of scope.
Comment #5
sqndr CreditAttribution: sqndr commentedThe first two issues I listed are, but the third question was do we need that last part? The scope of the issue seems to be removing 'unused classes'; and it seems like not all the 'unused classes' are removed in the issue.
Setting it back to 'Needs review' to see what testbot has to say. :)
As discussed with @alexpott - I'll create a new issue for removing the last part 'cause it might need some more work. This keep the issue scope nice and small.
Comment #6
joelpittetNice cleanup! I double checked and there are no uses in seven and even bartik has converted most to .layout-sidebar-first/no-sidebars/on-sidebar.
@sqndr I think we are "re-imagining" that hunk here: #2329753: Move html classes from preprocess to templates
Comment #7
Wim LeersRTBC++
Comment #9
webchickNice find. Committed and pushed to 8.0.x. Thanks!