CMS MADE SIMPLE FORGE

Frontend Users

 

[#4932] multiselect list bug

avatar
Created By: Gerrit Duran (gdur)
Date Submitted: Fri May 14 16:31:28 -0400 2010

Assigned To: Robert Campbell (calguy1000)
Version: 1.8.5
CMSMS Version: None
Severity: Major
Resolution: Fixed
State: Closed
Summary:
multiselect list bug
Detailed Description:
In the back end editing a user the following error occurs;
when using multi select list and assign it as required I'm unable to store the
info and an error message tells " is a required field"  which I did.  I've tried
it with a single selection as well as multiple selections but none seem to work.
Switching required to Optional doesn't store either the selection(s).
In the frontend however is does work like one would expect! As a required as
well as optional.

After storing a selection in the frontend the selection appears in the backend
however, after storing it in the backend the setting(s) is/are lost again.

Also export csv data is running into an error, the csv file only contains: There
is a problem with the options for Array field in record xxx@xxxx.com<br />


History

Comments
avatar
Date: 2010-05-14 20:46
Posted By: Jan Bakke (janb)

It seems like the bug is in action.do_edituser3.php

When getting fields, trim is destroying the multiselect array and give "array"
as the value to $fields[$fldname] in line 97.

So a proposal to fix this is to handle multiselect special like this: 
(put this in at line 93 before default:)

    case 5:
      if( isset($params['input_'.$fldname]) )
        {
        if( is_array( $params['input_'.$fldname]) )
          {
             $fields[$fldname] = implode(',',$params['input_'.$fldname]);
          }
        }
      break;

      
Updates

Updated: 2012-11-28 12:51
state: Open => Closed

Updated: 2012-07-30 00:17
resolution_id: => 7
cmsms_version_id: => -1