Skip to content

Saving settings without selecting a filesystem during install results in warning on plugin settings page #530

@marxjohnson

Description

@marxjohnson

The following warnings are displayed on the plugin settings page:

Warning: Trying to access array offset on value of type null in /var/www/moodlecore/lib/adminlib.php on line 4053
Warning: Trying to access array offset on value of type null in /var/www/moodlecore/lib/adminlib.php on line 4059

Steps to reproduce:

  1. Install objectFS
  2. On the "New plugin settings" page, leave all the plugin settings as default and click "Save changes"
  3. Navigate to "Site Adminstration > Plugins > Admin tools > Object storage file system > Plugin settings"
  4. Set "Storage File System" to \tool_objectfs\s3_file_system and click "Save changes"
  5. Several PHP Warnings will be output to the top of the page (or the log, if display_errors is off). The "Pre-Signed URL expiration time" field will be empty, even though the default is 2 hours.

This is because unless you select a file system during installation, the expiration time field is never displayed, and so no value is saved for the setting. The admin_setting_configduration class assumes the setting was saved during installation, and so doesn't cope well when it is empty.

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