Problem/Motivation

Running drupal check and found 2 deprecated functions:
line 32: Call to deprecated method url() of class Drupal.
line 430: Call to deprecated function drupal_unlink()

Proposed resolution

Remove and Replace deprecated functions

CommentFileSizeAuthor
#3 3047836-3.patch2 KBinbalj

Comments

inbalj created an issue. See original summary.

inbalj’s picture

I'm at DrupalCon Seattle and currently working on this issue.

inbalj’s picture

Status: Active » Needs review
StatusFileSize
new2 KB

I made the requested changes. Here is the patch to be reviewed.

amateescu’s picture

Status: Needs review » Needs work
+++ b/core/modules/color/color.module
@@ -427,7 +428,7 @@ function color_scheme_form_submit($form, FormStateInterface $form_state) {
+      @unlink($file);

We have to use \Drupal::service('file_system')->unlink() here :)

berdir’s picture

Thanks for your patch. Unfortunately, there are already issues for both your changes: #3021434: Properly deprecate drupal_unlink() and #2731817: Replace all calls to the deprecated Drupal::url() function in Core. Both are updating all deprecated usages of their respective functions and it doesn't make much sense to these two separately.

The drupal-check tool is mostly meant for contributed modules, drupal core has a difference process. I think this needs to be closed as a duplicate.

voleger’s picture

Status: Needs work » Closed (duplicate)