Skip to content

[a02219f] [Moodle 4.5.12] [PHP 8.3] Some undefined array keys in classes/importer.php #58

Description

@danowar2k

Describe the bug
Seen in PHP error log.

[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  Undefined array key "tiny_elements_flavor" in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 234
[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  foreach() argument must be of type array|object, null given in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 234
[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  Undefined array key "tiny_elements_variant" in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 238
[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  foreach() argument must be of type array|object, null given in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 238
[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  Undefined array key "tiny_elements_comp_flavor" in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 242
[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  foreach() argument must be of type array|object, null given in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 242
[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  Undefined array key "tiny_elements_comp_variant" in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 246
[09-Jun-2026 09:10:12 Europe/Berlin] PHP Warning:  foreach() argument must be of type array|object, null given in /var/moodle/htdocs/moodle/lib/editor/tiny/plugins/elements/classes/importer.php on line 246

Probably happened in our manual test, when I exported a category and imported the resulting export file again.
All look like the same basic thing. The category probably doesn't have the expected things and the errors result of this.

To Reproduce
Steps to reproduce the behavior:

  1. Go to management
  2. Export a category
  3. Import the exported file again

Expected behavior
No error should occur in the log.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome
  • Version 148.0.7778.179

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions