I have Removed the deprecated method \Drupal::l and replaced \Drupal::l with Link::fromTextAndUrl in Link module.
Please find the attached patch.

Comments

Swetha Yarla created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, link.patch, failed testing.

Swetha Yarla’s picture

Version: 8.1.x-dev » 8.0.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.79 KB
heykarthikwithu’s picture

StatusFileSize
new1.83 KB

Updated with changes.

Status: Needs review » Needs work

The last submitted patch, 4: 2699545-4.patch, failed testing.

vg3095’s picture

Status: Needs work » Needs review
StatusFileSize
new1.78 KB

Status: Needs review » Needs work

The last submitted patch, 6: 2699545-6.patch, failed testing.

Swetha Yarla’s picture

Version: 8.0.x-dev » 8.0.0
Status: Needs work » Needs review
StatusFileSize
new1.79 KB

Status: Needs review » Needs work

The last submitted patch, 8: link1.patch, failed testing.

Swetha Yarla’s picture

Version: 8.0.0 » 8.1.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.79 KB
Swetha Yarla’s picture

Version: 8.1.x-dev » 8.0.4
dawehner’s picture

Version: 8.0.4 » 8.2.x-dev

We should always patch against the latest dev version. Thank you for providing a patch!

n.kishorekumar’s picture

Re rolling the patch to the version 8.2.x-dev

n.kishorekumar’s picture

Status: Needs review » Needs work
n.kishorekumar’s picture

Assigned: n.kishorekumar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.82 KB

Please find the patch...

Status: Needs review » Needs work

The last submitted patch, 15: drupal-2699545-15.patch, failed testing.

dawehner’s picture

+++ b/core/modules/link/src/Tests/LinkFieldTest.php
@@ -318,7 +319,7 @@ function testLinkTitle() {
-    $expected_link = \Drupal::l($value, Url::fromUri($value));
+    $expected_link = Link::fromTextAndUrl($value, Url::fromUri($value));

@@ -330,7 +331,7 @@ function testLinkTitle() {
-    $expected_link = \Drupal::l($title, Url::fromUri($value));
+    $expected_link = Link::fromTextAndUrl($title, Url::fromUri($value));

Those changes don't really make sense. Here we want to check for the actual string, so maybe use ->toString in there

mac_weber’s picture

Status: Needs work » Needs review
StatusFileSize
new2.61 KB
new3.21 KB

- Fixed what was pointed by @dawehner at #17
- Fixed preprocess function to use the same object as before for rendering
- Moved use to alphabetical order
- Changed comment at twig template:

diff --git a/core/modules/link/templates/link-formatter-link-separate.html.twig b/core/modules/link/templates/link-formatter-link-separate.html.twig
index 469cd9a..b238b4e 100644
--- a/core/modules/link/templates/link-formatter-link-separate.html.twig
+++ b/core/modules/link/templates/link-formatter-link-separate.html.twig
@@ -4,7 +4,8 @@
  * Default theme implementation of a link with separate title and URL elements.
  *
  * Available variables:
- * - link: The link that has already been formatted by l().
+ * - link: The link that has already been formatted by
+ *   \Drupal\Core\Link::fromTextAndUrl()->toString().
mahtoranjeet’s picture

Reviewed and Tested Patch.
Replaced \Drupal::l with Link::fromTextAndUrl() in Link Module
Patch is working as expected.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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.

quietone’s picture

Status: Needs review » Closed (duplicate)

Thanks to everyone who worked on this patch.
This was fixed in #2731817: Replace all calls to the deprecated Drupal::url() function in Core in April 2019, I am closing this as a duplicate of that one.