Moodle
  1. Moodle
  2. MDL-10401

Undefined string in admin - 'sectionerror'

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8, 1.8.1, 1.8.2
    • Fix Version/s: 1.8.4
    • Component/s: Administration
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE
    • Rank:
      28857

      Description

      The following error message in the administration section is not defined in the language pack:

      admin/settings.php:41: error(get_string('sectionerror', 'admin'));
      lib/adminlib.php:2626: error(get_string('sectionerror','admin'));

        Issue Links

          Activity

          Hide
          Wen Hao Chuang added a comment -

          another quick fix. The string should go into /lang/en_utf8/admin.php (based on my understanding of moodle convention). Just added the string based on moodle convention and got it committed into 1.8_STABLE, will commit it to HEAD and other branches later too.

          Show
          Wen Hao Chuang added a comment - another quick fix. The string should go into /lang/en_utf8/admin.php (based on my understanding of moodle convention). Just added the string based on moodle convention and got it committed into 1.8_STABLE, will commit it to HEAD and other branches later too.
          Hide
          Howard Miller added a comment -

          I was kinda hoping for an error message that described what the problem might be. Ordinarily I would just have added the string myself without causing "tracker noise", but I had no idea what the error meant.

          Show
          Howard Miller added a comment - I was kinda hoping for an error message that described what the problem might be. Ordinarily I would just have added the string myself without causing "tracker noise", but I had no idea what the error meant.
          Hide
          Wen Hao Chuang added a comment -

          Sorry Howard if I seems to be rude to jump right in to solve the problem right away, my apologies. I'm still trying to get myself familiar with the workflow here on the moodle bug tracker so please bear with me... (newbie here!)

          By the way I think for this particular error, it usually throw out from from admin/settings.php (please correct me if I'm wrong)..

          ---- line #40
          $adminroot = admin_get_root();

          $root = $adminroot->locate($PAGE->section);

          if (!is_a($root, 'admin_settingpage'))

          { error(get_string('sectionerror', 'admin')); die; }

          if (!($root->check_access()))

          { error(get_string('accessdenied', 'admin')); die; }

          $CFG->pagepath = 'admin/setting/'.$section;


          Actually if you directly point your local browser to http://localhost/moodle18/moodle/admin/settings.php you could get this error message right away. It probably could happen with different scenario so don't know if we could be more descriptive about it. One scenario (like directly access that page with teacher permission) would be similar to the error message that you would be getting (login as instructor while you don't have permissions to directly access /admin/settings.php page) for access /admin/ folder:

          Sorry, but you do not currently have permissions to do that (Change site configuration)
          (see screenshot)

          But then this is just one scenario, there should be other scenarios I think.. so maybe just throw out a "Section Error!" message for now until we could find a better alternative? Again just my 2c

          Show
          Wen Hao Chuang added a comment - Sorry Howard if I seems to be rude to jump right in to solve the problem right away, my apologies. I'm still trying to get myself familiar with the workflow here on the moodle bug tracker so please bear with me... (newbie here!) By the way I think for this particular error, it usually throw out from from admin/settings.php (please correct me if I'm wrong).. ---- line #40 $adminroot = admin_get_root(); $root = $adminroot->locate($PAGE->section); if (!is_a($root, 'admin_settingpage')) { error(get_string('sectionerror', 'admin')); die; } if (!($root->check_access())) { error(get_string('accessdenied', 'admin')); die; } $CFG->pagepath = 'admin/setting/'.$section; Actually if you directly point your local browser to http://localhost/moodle18/moodle/admin/settings.php you could get this error message right away. It probably could happen with different scenario so don't know if we could be more descriptive about it. One scenario (like directly access that page with teacher permission) would be similar to the error message that you would be getting (login as instructor while you don't have permissions to directly access /admin/settings.php page) for access /admin/ folder: Sorry, but you do not currently have permissions to do that (Change site configuration) (see screenshot) But then this is just one scenario, there should be other scenarios I think.. so maybe just throw out a "Section Error!" message for now until we could find a better alternative? Again just my 2c
          Hide
          Petr Škoda added a comment -

          hi, thanks for the fix
          this error is thrown if the url contains no or wrong section name - there is not much we can do with that info, please reopen if you have any idea how to improve it
          I have also added link to site/admin/ into the error() call

          Show
          Petr Škoda added a comment - hi, thanks for the fix this error is thrown if the url contains no or wrong section name - there is not much we can do with that info, please reopen if you have any idea how to improve it I have also added link to site/admin/ into the error() call
          Hide
          Nicolas Martignoni added a comment -

          Verified, closing.

          Show
          Nicolas Martignoni added a comment - Verified, closing.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: