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.
There are lots of _url() and _l() calls still outstanding inside comments/documentation:
_url()
core/lib/Drupal/Core/Routing (3 usages found)
UrlGeneratorInterface.php (3 usages found)
(69: 67) * - 'entity_type': The entity type of the object that called _url(). Only
(70: 17) * set if _url() is invoked by Drupal\Core\Entity\Entity::uri().
(72: 33) * generated. Only set if _url() is invoked by Drupal\Core\Entity\Entity::uri().
core/modules/views/src/Plugin/views/field (1 usage found)
FieldPluginBase.php (1 usage found)
(1244: 56) // Make sure that paths which were run through _url() work as well.
l()
core/lib/Drupal/Core/Menu (1 usage found)
LocalTaskManager.php (1 usage found)
(266: 26) // Normally, _l() compares the href of every link with the current
core/lib/Drupal/Core/Render/Element (4 usages found)
Link.php (4 usages found)
(37: 60) * A structured array whose keys form the arguments to _l():
(38: 55) * - #title: The link text to pass as argument to _l().
(40: 62) * - #options: (optional) An array of options to pass to _l() or the link
(47: 44) // By default, link options to pass to _l() are normally set in #options.
core/modules/language/src/Tests (4 usages found)
LanguageSwitchingTest.php (4 usages found)
(295: 32) // Test links generated by _l() on an English page.
(320: 32) // Test links generated by _l() on a French page.
(356: 32) // Test links generated by _l() on an English page.
(375: 32) // Test links generated by _l() on a French page.
core/modules/language/tests/language_test/src/Controller (1 usage found)
LanguageTestController.php (1 usage found)
(74: 64) * Using #type 'link' causes these links to be rendered with _l().
core/modules/link/src/Plugin/Field/FieldFormatter (2 usages found)
LinkFormatter.php (1 usage found)
(193: 26) // by default in _l().
LinkSeparateFormatter.php (1 usage found)
(58: 26) // by default in _l().
core/modules/link/src/Tests (1 usage found)
LinkFieldTest.php (1 usage found)
(386: 8) // _l() and options/attributes. Only 'url_plain' has a dependency on
core/modules/simpletest/src (1 usage found)
TestBase.php (1 usage found)
(864: 20) // Not using _l() to avoid invoking the theme system, so that unit tests
core/modules/system (4 usages found)
language.api.php (1 usage found)
(98: 46) * translated link text before going through _l(), which will just handle the
menu.api.php (2 usages found)
(355: 64) * - options: (optional) An array of options to be passed to _l() when
(377: 58) * - localized_options: An array of options to pass to _l().
system.api.php (1 usage found)
(510: 69) * exposed as the 'link_generator' service or a link generated by _l(). If the
core/modules/system/src/Tests/Common (12 usages found)
UrlTest.php (12 usages found)
(18: 59) * \Drupal\Component\Utility\UrlHelper::buildQuery(), and _l() work correctly
(36: 113) $this->assertTrue(strpos($link, $sanitized_path) !== FALSE, format_string('XSS attack @path was filtered by _l().', array('@path' => $path)));
(71: 51) // Test the active class in links produced by _l() and #type 'link'.
(91: 62) $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page is marked active.');
(94: 62) $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string when the current page has no query string is not marked active.');
(98: 62) $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string that matches the current query string is marked active.');
(101: 62) _l()
(104: 62) $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page without a query string when the current page has a query string is not marked active.');
(106: 56) // Test adding a custom class in links produced by _l() and #type 'link'.
(107: 13) // Test _l().
(132: 26) // Build a link with _l() for reference.
(135: 42) // Test a renderable array passed to _l().
core/modules/system/src/Tests/Theme (1 usage found)
FunctionsTest.php (1 usage found)
(174: 35) // Turn off the query for the _l() function to compare the active
core/modules/system/tests/modules/common_test/src/Controller (1 usage found)
CommonTestController.php (1 usage found)
(22: 64) * Using #type 'link' causes these links to be rendered with _l().
core/modules/views/src/Plugin/views/field (1 usage found)
FieldPluginBase.php (1 usage found)
(1445: 44) // convert back to an array form for _l().
core/modules/views/src/Tests (1 usage found)
ViewStorageTest.php (1 usage found)
(188: 36) // Enable the system module so _l() can work using url_alias table.
We should get these cleaned up.
Only normal because it doesn't render the system, or any part of the system, unusable.
Comment | File | Size | Author |
---|---|---|---|
#37 | interdiff-34-37.txt | 1.47 KB | sdstyles |
#37 | update_remaining_url-2410497-37.patch | 23.45 KB | sdstyles |
#34 | update_remaining_url-2410497-34.patch | 23.36 KB | alvar0hurtad0 |
#34 | interdiff.txt | 7.37 KB | alvar0hurtad0 |
#30 | update_remaining_url-2410497-30.patch | 23 KB | alvar0hurtad0 |
Comments
Comment #1
Vijayac CreditAttribution: Vijayac commentedworking on this issue
Comment #2
Vijayac CreditAttribution: Vijayac commentedWorking on this issue
Comment #3
webchickchilukuri, do you have a patch to upload by chance? Otherwise, this would make good fodder for people at the DrupalCamp NJ sprint happening now.
Comment #4
webchickAlso, expanding scope, adding an up-to-date grep to issue summary.
Comment #5
YesCT CreditAttribution: YesCT commentedthanks for trying this.
un-assigning since it has been a while.
If you have questions or partial work, please make a comment on the issue.
Comment #6
webchickUpdated issue summary with a new grep that optimistically reflects the codebase after #2343669: Remove _l() and _url() makes it in.
Comment #7
webchick$indentation--;
Comment #8
hussainwebI got here from #2424525: Remove references to _l() and _url(). Man, what a nice number! It's a pity to see that closed. :)
I am uploading the patch from #2424525-1: Remove references to _l() and _url() here to get things started.
Comment #9
webchickLOL oh, dang! Yes that node ID is clearly superior. :) Thanks so much for tackling this!
Comment #10
hussainwebNote to reviewers:
These doesn't seem to be used at all. I couldn't find the uri() methods on Entity class, and the similarly named url() method had no reference to this properties nor any other function call that might work up on this.
Comment #11
mpdonadio@hussainweb, do you think you caught all of them or are you still working on this? I'm not going to work on this issue directly so I can do proper reviews instead.
Comment #12
hussainweb@mpdonadio: No, I had actually mentioned this in my other comment but forgot to copy it here. Basically, I am calling it a day and plan to catch the remaining tomorrow. I just wanted to get started on this.
Comment #13
hussainwebSetting to Needs Work accordingly.
Comment #14
ifrikShould this be taken up during the sprints at DrupalCon Barcelona?
If so, then it should be tagged with Barcelona2015.
Comment #15
mpdonadioYeah, this slipped through the cracks. Current patch doesn't apply either. Since _url() and _l() are long gone, usages need to be found with search and/or grep.
Comment #16
alvar0hurtad0start working on reroll
Comment #17
alvar0hurtad0Here's the reroll.
Comment #18
hussainwebComment #21
hussainwebIt's a random failure as the changes are only in comments. Retesting...
Comment #22
hussainwebIt's a random failure as the changes are only in comments. Retesting...
Comment #23
DuaelFrComment #24
adancillo CreditAttribution: adancillo as a volunteer commentedShould this contain the full class name?
Comment #25
NitebreedThe provided patch is not only removing the calls but updating the documentation, so therefore I'm updating the title.
Comment #26
wizonesolutionsI mentored on this issue.
Comment #27
jhodgdonI think it's OK as it is. Thanks!
Comment #28
alexpottAfter applying the patch I still appear to have 22 occurences of
_l()
- for example in core/modules/system/src/Tests/Common/UrlTest.phpAnd 3 occurrences of
_url()
all in core/lib/Drupal/Core/Routing/UrlGeneratorInterface.phpComment #29
alvar0hurtad0Rerolled again>
Comment #30
alvar0hurtad0And this fixing #28 report
Comment #31
jhodgdonThanks! I checked and I think this patch covers all the _url() and _l() calls now... not 100% sure about _url() because I checked with grep, nad there are a lot of other functions called things like check_url() etc. that complicated things... but fairly sure. _l() is definitely covered.
So... The new patch looks mostly OK but there are a few problems:
This documentation line goes over 80 characters, and needs to be rewrapped.
over 80 characters in code comment lines is also a standards violation. Needs rewrap.
This change is technically out of scope for the issue... but that's probably OK.
maybe fix the punctuation here too? It should be:
... will be set; otherwise, 'path' ...
over 80 characters, rewrap.
Also, class name should start with \
Class name should start with \
over 80 chars, rewrap
over 80 chars, rewrap
over 80 chars, rewrap
over 80 chars, rewrap
over 80 chars, rewrap
Comment #32
mpdonadioI stubbed _url() and _l() back into common.inc and ran a usage report in PhpStorm w/ the patch applied and didn't get and results. Also searched for ' _l(' and ' _url(' and didn't see anything. I'm confident the patch caught everything, but I did not review the actual patch.
Comment #33
jhodgdonMost of what is being fixed here (if not all) is references in docs and comments, so I doubt PhpStorm would find it ?
Comment #34
alvar0hurtad0Thanks for your revision and your time.
This is the patch with fixed on #31
Comment #35
mpdonadioFind Usages in PhpStorm will catch @see references, which is why I also ran text searches on those specific strings to double check the grep/ag checks.
Comment #36
jhodgdonAlmost there! Two spots still need a quick fix:
This class name still needs to start with \
This is still over 80 characters and needs rewrapping.
Comment #37
sdstyles CreditAttribution: sdstyles at FFW commentedComment #38
jhodgdonThanks! Looks good now.
Comment #39
webchickYay, so happy to see this RTBC!
Committed and pushed to 8.0.x. Thanks!