Acceptance Criteria:

Refactor a deprecated function drupal_get_path()

See also: https://www.drupal.org/node/2940438

drupal_get_path()

If you want to specify the type dynamically you can use:

drupal_get_path('module', 'node') -> \Drupal::service('extension.path.resolver')->getPath('module', 'node')

Issue fork cloud-3227311

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

XLD created an issue. See original summary.

xld’s picture

Issue summary: View changes

xld’s picture

Status: Active » Needs work
ankithashetty’s picture

Status: Needs work » Needs review

There is a MR to be reviewed in #3, so changing status to "Needs review", thanks!

xld’s picture

StatusFileSize
new16.41 KB
yas’s picture

Status: Needs review » Needs work

@XLD

Thank you for the refactoring. It looks good to me; I posted my comments above. Please check the ones. Thanks!

yas’s picture

@XLD

Also, please fix a coding standard violation.

xld’s picture

Status: Needs work » Needs review
StatusFileSize
new16.53 KB

Status: Needs review » Needs work

The last submitted patch, 9: 3227311-9.patch, failed testing. View results

xld’s picture

Status: Needs work » Needs review
StatusFileSize
new16.54 KB

@Yas, To call the function in your proposed way in the Trait we need to create a constructor which is not entirely recommended for traits. I have uploaded the patch with the remaining changes but please review it and advise further. Thank you.

yas’s picture

Status: Needs review » Needs work

@XLD

Thank you for your update.

To call the function in your proposed way in the Trait we need to create a constructor which is not entirely recommended for traits.

Yes, I agree with you. Please put the comment as you said. Also, please rebase the branch.

Thanks!

xld’s picture

Status: Needs work » Needs review
StatusFileSize
new779 bytes
xld’s picture

StatusFileSize
new855 bytes

Updated patch after rebase.

xld’s picture

StatusFileSize
new16.68 KB
xld’s picture

yas’s picture

Status: Needs review » Reviewed & tested by the community

@XLD

Thank you for the update. It looks good to me. I'll merge the patch to 4.x and close this issue as Fixed.

  • yas committed 2a07fcd on 4.x authored by XLD
    Issue #3227311 by XLD, yas: Refactor deprecated function drupal_get_path...

yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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