Depreciated report for Node authorize link

------ ----------------------------------------------------------------------------------
Line node_authlink.module
------ ----------------------------------------------------------------------------------
137 Call to deprecated function db_select():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get
a database connection injected into your service from the container and
call select() on it. For example,
149 Call to deprecated function drupal_set_message():
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
162 Call to deprecated function db_select():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get
a database connection injected into your service from the container and
call select() on it. For example,
173 Call to deprecated function drupal_set_message():
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
194 Call to deprecated function db_query():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead,
get a database connection injected into your service from the container
and call query() on it. For example,
358 Call to deprecated method randomBytes() of class Drupal\Component\Utility\Crypt:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Use PHP's built-in random_bytes() function instead.
361 Call to deprecated function db_insert():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get
a database connection injected into your service from the container and
call insert() on it. For example,
384 Call to deprecated function db_delete():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get
a database connection injected into your service from the container and
call delete() on it. For example,
393 Call to deprecated function node_type_get_types():
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\node\Entity\NodeType::loadMultiple().
403 Call to deprecated function db_select():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get
a database connection injected into your service from the container and
call select() on it. For example,
412 Call to deprecated function db_delete():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get
a database connection injected into your service from the container and
call delete() on it. For example,
------ ----------------------------------------------------------------------------------

------ --------------------------------------------------------------------------
Line src\Form\NodeAuthlinkNodeForm.php
------ --------------------------------------------------------------------------
77 Call to deprecated method entityManager() of class Drupal:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal::entityTypeManager() instead in most cases. If the needed
method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the
deprecated \Drupal\Core\Entity\EntityManager to find the
correct interface or service.
204 Call to deprecated function drupal_set_message():
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ --------------------------------------------------------------------------

[ERROR] Found 13 errors

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kswamy created an issue. See original summary.

malaynayak’s picture

Assigned: Unassigned » malaynayak
selva.swamy@gmail.com’s picture

@malaynayak Am Looking into this issue

malaynayak’s picture

Status: Active » Needs review
FileSize
6.11 KB

@kswamy I have created the patch. Please review.

malaynayak’s picture

Issue tags: +GCWIndia2020, +punedrupalgroup
malaynayak’s picture

FileSize
361 bytes
6.83 KB

Added core_version_requirement into .info.yml file.

malaynayak’s picture

FileSize
6.47 KB
390 bytes

Added a wrong patch on #6. Adding the correct one with interdiff.

msuthars’s picture

Status: Needs review » Reviewed & tested by the community

@malaynayak Thanks for the patch. I applied patch and check manually & with the upgrade status module, The patch is Drupal 9 compatible.

pratik_kamble’s picture

@malaynayak

     foreach ($form_state->getValues() as $key => $value) {
-      drupal_set_message($key . ': ' . $value);
+      $this->messenger->addMessage($key . ': ' . $value);

$this->messenger->addMessage($key . ': ' . $value); should be $this->messenger()->addMessage($key . ': ' . $value);

pratik_kamble’s picture

Status: Reviewed & tested by the community » Needs work
malaynayak’s picture

Status: Needs work » Needs review
FileSize
6.47 KB
212 bytes

Thanks @pratik_kamble for pointing out the issue.

Adding the modified patch, please review.

ravimane23’s picture

I applied #11 patch and check manually & with the upgrade status module, The patch worked for me.

selva.swamy@gmail.com’s picture

Assigned: selva.swamy@gmail.com » Unassigned
Eduardo Morales Alberti’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
6.43 KB
267 bytes

Added patch removing composer compatibility because does not apply using composer patches, (this patch is only for composer patches) based on #11 patch.

Patch reviewed using upgrade status module.

Eduardo Morales Alberti’s picture

Sorry, I uploaded the wrong patch for composer patches.

hudri’s picture

Do NOT use patch #14 or #15, it contradicts the core purpose of this issue! Patch #11 is the last correct one.

If you want to install a v8 only module with composer, see this post on Drupal Answers

  • malaynayak authored 2fc0c26 on 8.x-1.x
    Issue #3108765 by malaynayak: Drupal 9 Deprecated Code Report
    
Honza Pobořil’s picture

Status: Reviewed & tested by the community » Fixed

Thank you

hudri’s picture

Hi @malaynayak and @Bobik,
could you please generate a new stable release containing the D9 patch? Even though we now can composer require the dev version in a D9 project, I still feel better when I don't have to add a dependency to dev-release in a live project.

Thank you very much.

Honza Pobořil’s picture

Do you think it is good idea to publish release after one week of testing in dev which probably nobody use?

hudri’s picture

Malaynayak's patch is already 11 month old, and there is no functional change in this patch, just 1:1 replacements like drupal_set_message to \Drupal::messenger() or db_select to \Drupal::database(). Can't see a lot of risk here.

Honza Pobořil’s picture

There were more commits what needs carantine, especially combined.

Status: Fixed » Closed (fixed)

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