Issue Details (XML | Word | Printable)

Key: MDL-10401
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Wen Hao Chuang
Reporter: Howard Miller
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Undefined string in admin - 'sectionerror'

Created: 10/Jul/07 08:57 PM   Updated: 09/Feb/08 05:38 AM
Return to search
Component/s: Administration
Affects Version/s: 1.8, 1.8.1, 1.8.2
Fix Version/s: 1.8.4

File Attachments: None
Image Attachments:

1. access_admin_folder_no_permission.png
(68 kB)
Issue Links:
Relates
 

Participants: Howard Miller, Nicolas Martignoni, Petr Skoda and Wen Hao Chuang
Security Level: None
QA Assignee: Nicolas Martignoni
Resolved date: 20/Dec/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE


 Description  « Hide
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'));

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Wen Hao Chuang made changes - 05/Oct/07 02:25 AM
Field Original Value New Value
Assignee Martin Dougiamas [ dougiamas ] Wen Hao Chuang [ chuang ]
whchuang committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 05/Oct/07 02:29 AM
added missing string definition for sectionerror. Fixed MDL-10401
MODIFY lang/en_utf8/admin.php   Rev. 1.103.2.16    (+2 -1 lines)
Wen Hao Chuang added a comment - 05/Oct/07 02:29 AM
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.

Howard Miller added a comment - 05/Oct/07 04:31 PM
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.

martignoni committed 1 file to 'Lang CVS' - 05/Oct/07 04:51 PM
Added missing string definition for sectionerror. Fixed MDL-10401.
MODIFY fr_utf8/admin.php   Rev. 1.195    (+2 -1 lines)
Wen Hao Chuang added a comment - 06/Oct/07 02:06 AM
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


Wen Hao Chuang made changes - 06/Oct/07 02:07 AM
Petr Skoda made changes - 01/Dec/07 06:17 AM
Link This issue has a non-specific relationship to MDL-12401 [ MDL-12401 ]
Petr Skoda committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 20/Dec/07 03:04 AM
MDL-10401 redirect to site/admin/ if section error found
MODIFY lib/adminlib.php   Rev. 1.153.2.12    (+2 -2 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 20/Dec/07 03:05 AM
MDL-10401 redirect to site/admin/ if section error found; merged from MOODLE_19_STABLE
MODIFY lib/adminlib.php   Rev. 1.165    (+2 -2 lines)
Petr Skoda added a comment - 20/Dec/07 03:10 AM
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

Petr Skoda made changes - 20/Dec/07 03:10 AM
Fix Version/s 1.8.4 [ 10242 ]
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Nicolas Martignoni added a comment - 09/Feb/08 05:38 AM
Verified, closing.

Nicolas Martignoni made changes - 09/Feb/08 05:38 AM
Status Resolved [ 5 ] Closed [ 6 ]
QA Assignee mina