Change active class in l() function to is-active according new CSS architecture (for Drupal 8).

This change requires change on function it self as well as in all CSS files where active link is styled.

Related issues

#1979468: ".active" from linkGenerator(), l() and theme_links() forces an upper limit of per-page caching for all content containing links

Files: 
CommentFileSizeAuthor
#32 active-css-class-change-2031641-32.patch47.72 KBmdrummond
FAILED: [[SimpleTest]]: [MySQL] 59,472 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#30 active-css-class-change-2031641-29.patch47.52 KBaburrows
FAILED: [[SimpleTest]]: [MySQL] 56,214 pass(es), 4 fail(s), and 0 exception(s).
[ View ]
#26 2031641-changeactiveclass-21.patch47.08 KBPol
FAILED: [[SimpleTest]]: [MySQL] 56,675 pass(es), 5 fail(s), and 0 exception(s).
[ View ]
#24 2031641-changeactiveclass-20.patch46.39 KBPol
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-20.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#24 interdiff.txt1.13 KBPol
#23 2031641-changeactiveclass-19.patch1.13 KBPol
FAILED: [[SimpleTest]]: [MySQL] 56,593 pass(es), 2 fail(s), and 0 exception(s).
[ View ]
#23 interdiff.txt1.13 KBPol
#21 2031641-changeactiveclass-18.patch46.99 KBPol
FAILED: [[SimpleTest]]: [MySQL] 56,592 pass(es), 5 fail(s), and 0 exception(s).
[ View ]
#21 interdiff.txt1 KBPol
#19 2031641-changeactiveclass-17.patch46.38 KBaburrows
FAILED: [[SimpleTest]]: [MySQL] 56,438 pass(es), 5 fail(s), and 0 exception(s).
[ View ]
#17 2031641-changeactiveclass-16.patch44.58 KBaburrows
FAILED: [[SimpleTest]]: [MySQL] 56,665 pass(es), 8 fail(s), and 0 exception(s).
[ View ]
#14 2031641-changeactiveclass-13.patch49.12 KBaburrows
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-13.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#11 2031641-changeactiveclass-10.patch29.35 KBaburrows
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-10.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#8 2031641-changeactiveclass-7.patch24.36 KBaburrows
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 2031641-changeactiveclass-3.patch727 bytesaburrows
FAILED: [[SimpleTest]]: [MySQL] 56,588 pass(es), 8 fail(s), and 1 exception(s).
[ View ]
#3 2031641-changeactiveclass-2.patch537 bytesaburrows
FAILED: [[SimpleTest]]: [MySQL] 56,906 pass(es), 8 fail(s), and 1 exception(s).
[ View ]

Comments

Assigned:Unassigned» aburrows

Assigned:aburrows» Unassigned
Issue tags:+CSS, +d8mux-css-cleanup

taggin

Assigned:Unassigned» aburrows
Status:Active» Needs review
StatusFileSize
new537 bytes
FAILED: [[SimpleTest]]: [MySQL] 56,906 pass(es), 8 fail(s), and 1 exception(s).
[ View ]

New 'is-active' class added

StatusFileSize
new727 bytes
FAILED: [[SimpleTest]]: [MySQL] 56,588 pass(es), 8 fail(s), and 1 exception(s).
[ View ]

Modified comment to suit new class name

@aburrows Thanks for this awesome fast replay and patch :)

This is a nice change to l() function, but this issue requires a little bit more changes in all CSS files in core which contains .active related styles and should be checked carefully which means Find & Replace can NOT be used.

This change requires change on function it self as well as in all CSS files where active link is styled.

@aburrows Thanks for this awesome fast replay and patch :)

This is a nice change to l() function, but this issue requires a little bit more changes in all CSS files in core which contains .active related styles and should be checked carefully which means Find & Replace can NOT be used.

This change requires change on function it self as well as in all CSS files where active link is styled.

Just about to submit with all the css changes done

StatusFileSize
new24.36 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Patch with all css class name changes.

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-7.patch, failed testing.

When applying I get the error:

Checking patch core/themes/seven/style.css...
error: while searching for:
  margin: 0 2px;
}
ul.primary li a:link,
ul.primary li a.active,
ul.primary li a:active,
ul.primary li a:visited,
ul.primary li a:hover,
ul.primary li.active a {
  display: block;
  float: left; /* LTR */
  padding: 0.615em 18px;
error: patch failed: core/themes/seven/style.css:244

StatusFileSize
new29.35 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-10.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Patch with additions of menu.inc added

Status:Needs work» Needs review

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-10.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new49.12 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-13.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

This should now contain all the amended items

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-13.patch, failed testing.

I need to get the latest HEAD and that should solve it.

Status:Needs work» Needs review
StatusFileSize
new44.58 KB
FAILED: [[SimpleTest]]: [MySQL] 56,665 pass(es), 8 fail(s), and 0 exception(s).
[ View ]

Patch is now working with latest head, I though I had latest HEAD but didn't. Now I do and just tested locally and it applied fine.

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-16.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new46.38 KB
FAILED: [[SimpleTest]]: [MySQL] 56,438 pass(es), 5 fail(s), and 0 exception(s).
[ View ]

This hopefully should stop the failing tests, hopefully in time before core updates

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-17.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1 KB
new46.99 KB
FAILED: [[SimpleTest]]: [MySQL] 56,592 pass(es), 5 fail(s), and 0 exception(s).
[ View ]

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-18.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1.13 KB
new1.13 KB
FAILED: [[SimpleTest]]: [MySQL] 56,593 pass(es), 2 fail(s), and 0 exception(s).
[ View ]

StatusFileSize
new1.13 KB
new46.39 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2031641-changeactiveclass-20.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Oops, my bad.

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-20.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new47.08 KB
FAILED: [[SimpleTest]]: [MySQL] 56,675 pass(es), 5 fail(s), and 0 exception(s).
[ View ]

Sorry for the noise, I had a problem with my patches!

@aburrows, @Pol I am so happy to see such a contribution from you on this really new task. Already see results from this soon :)

Can you guys please follow the patch naming convention and help core maintainer to not become confused?

@Dragan Eror sorry got into bad practice with that, can't remember where I saw it

Status:Needs review» Needs work

The last submitted patch, 2031641-changeactiveclass-21.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new47.52 KB
FAILED: [[SimpleTest]]: [MySQL] 56,214 pass(es), 4 fail(s), and 0 exception(s).
[ View ]

Status:Needs review» Needs work

The last submitted patch, active-css-class-change-2031641-29.patch, failed testing.

Assigned:aburrows» Unassigned
Status:Needs work» Needs review
StatusFileSize
new47.72 KB
FAILED: [[SimpleTest]]: [MySQL] 59,472 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Here's a reroll of this patch.

15 files with merge conflicts! Not surprising after a few months.

What I haven't done is to go through all of Drupal core to see if there are any new files that might have the active class which needs to be changed to is-active. Hope this serves as an updated patch to move forward with that work.

Status:Needs review» Needs work

The last submitted patch, active-css-class-change-2031641-32.patch, failed testing.

I've found a few more mentions of class 'active' in:

  • LinkGenerator.php
  • LinkGeneratorTest.php
  • LocalTaskDefault.php
  • UrlTest.php
  • toolbar.js

@Lewis, is this issue still outstanding? If so assign to me and i'll sort it tonight.