Mantis - Quercus
Viewing Issue Advanced Details
5278 major always 11-17-12 20:43 12-29-12 23:06
kevinw8801  
nam  
normal  
closed 4.0.31  
fixed  
none    
none 4.0.34  
0005278: can not save permission in drupal6.26
- install drupal6.26
- go to adminster page
- click permissions
- check any permission and click save permissions
- it will report following error
"An illegal choice has been detected. Please contact the site administrator"
- while this works very well in php environment

after some investigation, it turns out that for the checked item in this form, the element key is added "_" automatically.
for example if check "administer blocks" for anonymous, after click "save permissions" button, there should be a element in the form with key "administer blocks" in the posted form array, while in quercus environment, it become ?administer_blocks?, why is understood added there?
 form2.jpg [^] (224,167 bytes) 11-17-12 20:43
 form1.jpg [^] (229,669 bytes) 11-20-12 18:53

Notes
(0006091)
nam   
11-20-12 20:04   
Thanks Keven for the bug report. Attachments are not working (because this site is running on a very old version of Quercus), but I should have all the information I need to reproduce the bug.
(0006092)
kevinw8801   
11-21-12 18:43   
thanks Nam! Basically the attachment is to show the data printed by krumo (from devel modules which is for debug), you can also check this way,

- go to drupal_installation_dir/includes/form.inc
- add var_dump($form) in line 410
   function drupal_process_form($form_id, &$form, &$form_state) {
   $form_state['values'] = array();
   var_dump($form["#post"]["1"]); // or krumo($form) if you use devel
- go to permission page
- check "administer blocks" for anonymous user
- click "save permission", then you'll get the dump like the following
array(2) { ["administer_blocks"]=> string(17) "administer blocks"

while using LAMP system, it will show the following,
array(2) { ["administer blocks"]=> string(17) "administer blocks"


- the key "administer_blocks" will have the form validate fail and report the error

function _form_validate($elements, &$form_state, $form_id = NULL) {
...
 foreach ($value as $v) { <= around line 715 in form.inc
            if (!isset($options[$v])) {
            form_error($elements, $t('===An illegal choice has been detected. Please contact the site administrator.'));
(0006129)
nam   
12-29-12 23:06   
php/080k

Fixed for 4.0.34. Thanks for the very detailed bug report! I introduced this bug while fixing other issues about 6 months.