Postponed on #3115223: Remove Stable as a base theme of core themes

Problem/Motivation

The issue #2402165: #theme => 'links' renders <li class="_"> when the #links array is not associative removed the ability to add classes to list items in #links via the array key. This is detailed in the change record. This had some unwanted side effects that weren't apparent until the BC layer in Stable was no longer available to core themes in #3115223: Remove Stable as a base theme of core themes
The issue focused on a bug that occurred when #links items were not associative: the list item would include class="_". However, the issue did not take into account that core has existing code that relied on this functionality.

At least one use case is clearly impacted by this, which was discovered in #3115223, and discovered while manually testing System Tray. Core has several CSS rules including the selector #drupal-off-canvas td .dropbutton-single li.edit (and children of this selector). The .edit class in this selector is added via the keys-become-classes functionality that was removed in #2402165. This is an item added to #links in \Drupal\menu_ui\MenuForm::buildOverviewTreeForm as '#links' => $operations. There is an $operations['edit'] and there is styling that assumes an .edit class will be added.

The result is you get this weirdness:

Instead of the nice pencils:

The BC layer was labeled as deprecated, but it shouldn't have been because there is still core functionality that depends on it.

Proposed resolution

Remove the BC workarounds added to the .theme files of Bartik, Claro, Seven and Umami in #3115223: Remove Stable as a base theme of core themes.

To fully address, it may require finding everywhere an associative array is used for #links and make sure those array keys are added as classes instead. It's also possible it can only be changed as needed.

Remaining tasks

Implement the proposed resolution

Address the @todo items referencing this issue.

User interface changes

API changes

Data model changes

Release notes snippet

Comments

bnjmnm created an issue. See original summary.

xjm’s picture

Title: [PP-1] Existing uses of #links should not rely on array keys to add classes to list items » Existing uses of #links should not rely on array keys to add classes to list items
Version: 9.0.x-dev » 9.1.x-dev

This isn't actually posptoned on anything, right?

I'm guessing this would be a minor-only change. Since 8.9.x and 9.0.x are now in beta, I'm moving this to 9.1.x. Thanks!

mherchel’s picture

Issue summary: View changes
mherchel’s picture

Issue summary: View changes

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Status: Active » Needs review
StatusFileSize
new3.73 KB

Difficult to know if anything will break without manually testing everything, but if we can't remove this now, when can we?

ranjith_kumar_k_u’s picture

StatusFileSize
new4.14 KB
new727 bytes

Status: Needs review » Needs work

The last submitted patch, 9: 3120962-9.patch, failed testing. View results

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.