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

Fix warning for mobile language strings in plugins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.1.6, 4.2.3
    • 4.1.5, 4.2.2, 4.3
    • Other
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-79277-401
    • MDL-79277-402
    • MDL-79277-master
    • Hide

      Installing a plugin that is using mobile lang strings with the default module should not throw a warning. For example, installing the local_greetings plugin (using the mobile_act_3 branch).

      Here's some specific instructions to do that:

      1. Log into a moodle site as an admin.
      2. Open Site administration > Plugins > Install plugins.
      3. Upload the plugin .zip ( moodle-local_greetings-mobile_act_3.zip file attached to this issue).
      4. Press "Install plugin from the ZIP file".
      5. Press "Continue" in the "Install plugin from ZIP file" page (some warnings related to the maturity level are expected on this step, you can ignore them).
      6. Press "Continue" in the "Current release information" page.
      7. Press "Upgrade Moodle database now" in the "Plugins check" page.
      8. Press "Continue" in the "Upgrading to new version" page.
      9. You should now be redirected to the "New settings - Greetings" page, without any warnings (before the fix, you'd see an "Undefined array key 1" warning in this page).
      Show
      Installing a plugin that is using mobile lang strings with the default module should not throw a warning. For example, installing the local_greetings plugin (using the mobile_act_3 branch). Here's some specific instructions to do that: Log into a moodle site as an admin. Open Site administration > Plugins > Install plugins. Upload the plugin .zip ( moodle-local_greetings-mobile_act_3.zip file attached to this issue). Press "Install plugin from the ZIP file". Press "Continue" in the "Install plugin from ZIP file" page (some warnings related to the maturity level are expected on this step, you can ignore them). Press "Continue" in the "Current release information" page. Press "Upgrade Moodle database now" in the "Plugins check" page. Press "Continue" in the "Upgrading to new version" page. You should now be redirected to the "New settings - Greetings" page, without any warnings (before the fix, you'd see an "Undefined array key 1" warning in this page).

      Mobile language strings are defined using an array with the string identifier and module name.

      However, in case the module is omitted (in order to use the default one), a warning is thrown trying to access an undefined index. This was probably introduced in some recent PHP version, but wasn't detected because it's quite an edge-case which only affects some plugins with mobile support.

            noeldemartin Noel De Martin
            noeldemartin Noel De Martin
            Dani Palou Dani Palou
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 18 minutes
                1h 18m

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