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.
Steps to reproduce.
1. Create a module with some themed page with template inside the module.
2. Create a link inside template (Something like l('Test link', $_GET['q'], array('fragment' = 'bottom'));
3. Browse to that page.
See, that this link has "active" class in HTML code.
4. Copy the template and paste it in your active theme directory.
5. Flush the cache and browse the page again.
Observe that link doesn't have "active" class now.
Expected:
1. Link should have "active" class in both cases.
2. No link with 'fragment' (and 'query' as well) option set should have "active" class.
Comments
Comment #1
Dako CreditAttribution: Dako commentedComment #2
Dako CreditAttribution: Dako commentedSeems like I was wrong about 4 and 5.
But anyway, link should not have "active" class is 'fragment' or 'query' options were passed.
Comment #3
maijs CreditAttribution: maijs commentedI agree, this is annoying. I'm developing a module that needs to point links to current page with different query strings and now all links have 'active' class attached to them.