Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82616

Moodle upgrade fail if $CFG->customfiletypes is set in config.php

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • 4.3.6, 4.4
    • Installation
    • None
    • MOODLE_403_STABLE, MOODLE_404_STABLE

      Hi,

      I had a bug during upgrade from Moodle 4.2 to Moodle 4.4.

      I have followed config-dist.php to set customfiletypes in my config.php. Here is my conf :

      $CFG->customfiletypes = array(
           (object)array(
               'extension' => 'ipynb',
               'icon' => 'archive',
               'type' => 'application/x-ipynb+json',
               'customdescription' => 'Jupyter Notebook'
           ),
           (object)array(
               'extension' => 'py',
               'icon' => 'sourcecode',
               'type' => 'text/plain',
               'customdescription' => 'Text file'
           ),
       );

       

      And what's in config-dist.php as example :

      // $CFG->customfiletypes = array(
      //     (object)array(
      //         'extension' => 'frog',
      //         'icon' => 'archive',
      //         'type' => 'application/frog',
      //         'customdescription' => 'Amphibian-related file archive'
      //     )
      // );

      But in lib/db/upgrade.php, some patches try to do :

      $custom = json_decode($CFG->customfiletypes);

       

      As $CFG->customfiletypes is not JSON, upgrade fails.

       

      I did not find any references to customfiletypes as JSON.

       

      Am I missing something ?

       

      The solution for me was to comment this part of my config then uncomment it.

       

      Thanks

      Baptiste

            Unassigned Unassigned
            baptiste.desprez Baptiste DESPREZ
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.