Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Undefined first and last name when a user updates their user profile #29

Open
wants to merge 1 commit into
base: v2.x
Choose a base branch
from

Conversation

kimhornung
Copy link

When a user saves their profile and WP debug is enabled, warnings about undefined variables appear in the debug.log file.

Furthermore, I think this issue might cause the first name and last name to be set to an empty string in SCORM (but I don't have access to our SCROM instance, so I could not check this - it might ignore the empty values).

Steps to reproduce

  1. Add the following lines to wp-config.php to enable WP debug
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
  1. In the backend go to Users > Profile

  2. Make sure the First Name and Last Name fields are not blank

  3. Save your user details

Result:
The following warnings appears in the /wp-content/debug.log file:

[08-Nov-2022 16:03:38 UTC] PHP Notice:  Undefined variable: user_first_name in <webroot>/scormcloud/scormcloudcontenthandler.php on line 225
[08-Nov-2022 16:03:39 UTC] PHP Notice:  Undefined variable: user_last_name in <webroot>/scormcloud/scormcloudcontenthandler.php on line 226

…names were not read correctly, leading to warnings about undefined variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant