Problem/Motivation

The module throws an error.

Warning: Undefined variable $websites in Drupal\do_username\DOComputedFields->getValue() (line 67 of /app/web/modules/contrib/do_username/src/DOComputedFields.php).

Steps to reproduce

Enter a user who has no websites listed on their Drupal.org profile and try to read all the fields. This is currently only possible via code but it can happen when we try to serialize the field.

Proposed resolution

It's a simple fix. The variable `$websites` should be reset to an empty array on line 64 in the file. This likely hides other bugs as well but the fix is simple.

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

hussainweb created an issue. See original summary.

hussainweb’s picture

Issue tags: +Novice
mohd sahzad’s picture

Assigned: Unassigned » mohd sahzad
mohd sahzad’s picture

Assigned: mohd sahzad » Unassigned
StatusFileSize
new419 bytes

I have updated the issue regarding the "Undefined variable $websites in Drupal\do_username\DOComputedFields->getValue()." please review the attached patch for the fix.

mohd sahzad’s picture

Status: Active » Needs review

zeshan.ziya made their first commit to this issue’s fork.

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

hussainweb’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #4 is good. I am afraid that MR !7 is targeting the wrong branch.

hussainweb’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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