Make this module compatible with Drupal 9.

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

asrob created an issue. See original summary.

gauravvvv’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new19.84 KB

Patch applied cleanly. Adding a after patch screenshot for reference. RTBC +1

anish.a’s picture

Status: Reviewed & tested by the community » Needs work

Error: Call to undefined method Drupal\user\Entity\User::getUsername() in event_log_track_user_update() (line 45 of *snip*docroot/modules/ported/events_log_track/event_log_track_user/event_log_track_user.module)

This is depricated.
https://api.drupal.org/api/drupal/core%21modules%21user%21src%21Entity%2...

akhilsoni’s picture

StatusFileSize
new16.88 KB

getUsername() is deprecated in drupal9 we can use getAccountName() instead.

weri’s picture

Status: Needs work » Needs review

TAGSkigen made their first commit to this issue’s fork.

asrob’s picture

Status: Needs review » Needs work

Hi @akhilsoni1992,

I tried to apply your patch but I could not. The problem is the following:

$ file -I drupal-9-username-issue.patch
drupal-9-username-issue.patch: text/x-diff; charset=utf-16le

I converted it

$ file -I drupal-9-username-issue-newer.patch
drupal-9-username-issue-newer.patch: text/x-diff; charset=us-ascii

and it works well, I can use git apply without any problems.

I think you should check (and re-upload) your patch so as to people can apply it cleanly.

kuldeep_mehra27’s picture

Assigned: Unassigned » kuldeep_mehra27
kuldeep_mehra27’s picture

Assigned: kuldeep_mehra27 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new8.24 KB

Problem in file encoding. I have fixed it and created new patch.

stijnhau’s picture

Any idea when this patch can be included

akhilsoni’s picture

StatusFileSize
new8.24 KB

Hello

I have recreated the patch with the us-ASCII format. Please find the patch below.

Thanks.

bhaskar-chakraborty’s picture

StatusFileSize
new26.98 KB

I make it entirely custom

ssoumya’s picture

#4 yes. Changing getUsername() to getAccountName() in all the .module files and adding core_version_requirement: ^8 || ^9 to .info.yml files does the job.

redzeuf’s picture

Status: Needs review » Needs work

I feel like in file src/OverviewForm.php line 61 it sound better to use getDisplayName() instead of getAccountName() has the Display Name is better to construct the Link to display. AccountName is the unique ID of the user for the identification, some user should add their email as account name and it's better not to display this private and system information to public.

redzeuf’s picture

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

Here is the patch regarding the diff of my previous message #14

redzeuf’s picture

StatusFileSize
new7.64 KB

The previous patch in message #15 is false. I make a mistake with the path of files.
I fixed it here.

smustgrave’s picture

Updated #16 to be used by composer.

smustgrave’s picture

Status: Needs review » Fixed

Started a 3.0.x branch with these changes.

smustgrave’s picture

Version: 8.x-2.x-dev » 3.0.x-dev

smustgrave’s picture

Status: Fixed » Closed (fixed)