Removed the deprecated method from the Simplenews module code base.

CommentFileSizeAuthor
simplenews.patch1.16 KBpashupathi nath gajawada

Comments

berdir’s picture

Status: Needs review » Needs work

Patch wasn't tested.

adamps’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Needs work
+++ b/src/Form/NewsletterForm.php
@@ -204,7 +204,7 @@ class NewsletterForm extends EntityForm {
 
-    $edit_link = \Drupal::linkGenerator()->generate($this->t('Edit'), $this->entity->urlInfo());
+    $edit_link = \Drupal::linkGenerator()->generate($this->t('Edit'), $this->entity->toUrl());
 
     if ($status == SAVED_UPDATED) {

Since we're touching this line anyway, linkGenerator()->generate() is also a pretty uncommon way to generate a link, $this->entity->toLink($this->t('Edit'))->toString() should give us the same result.

adamps’s picture

Assigned: pashupathi nath gajawada » Unassigned
Status: Needs work » Reviewed & tested by the community
Issue tags: -Quick fix +Plan to commit

@Berdir please can I just commit this?

  1. We still have a backlog of deprecations which must be fixed by D9 and even in D8 they give warnings in testing. I don't plan to fix them all myself so welcome anyone who is willing to help. I agree the existing code is odd, but it works and we have lots of other big problems to worry about.
  2. I completely agree with the " we are touching this line anyway" principle. However with a deprecation fix it's different: the developer has just done search/replace so we aren't necessarily testing this line anyway. Similarly trying to tidy up whilst fixing deprecations nearly introduced subtle bugs in #2759185: Use of SafeMarkup::checkPlain, which was deprecated .

  • 1b1873c committed on 8.x-1.x
    Issue #2694393 by pashupathi nath gajawada, Berdir, AdamPS: Urlinfo...
adamps’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Plan to commit

Thanks @Pashupathi Nath Gajawada

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.