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 warnings about undefined 'metadata' variables in debug.log #30

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

Conversation

kimhornung
Copy link

When WP debug is enabled, a number of warnings about undefined variables appear in the debug.log file.
However, it might depend on how the course/training is defined in SCORM for these warnings to appear.

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. Edit a page (and if you are using the Block Editor, add a Classic block)

  2. Use the "Insert a SCORM Cloud training link" button and insert a SCORM Cloud embed code.

  3. Publish the page

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

[08-Nov-2022 15:49:00 UTC] PHP Notice:  Undefined property: RusticiSoftware\Cloud\V2\Model\CourseSchema::$metadata in <webroot>/scormcloud/scormcloudcontenthandler.php on line 56
[08-Nov-2022 15:49:00 UTC] PHP Notice:  Undefined variable: metadata in <webroot>/scormcloud/scormcloudcontenthandler.php on line 62

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