Subscribe: RSS
  • Hi Guys,

    I am using webloginpe 1.4.1 with the inputHandler create multiselect lists.

    Works great on the login and create profile pages.

    But on the manager page which the admin uses to fix peoples accounts the multiselect wont pull in the selections if there are a few options picked.

    So normal select lists work, its only the multiselect lists when a few options are picked. If only one option is picked from the multiselect its also fine.

    The multiselect also seams to save to the database not matter what, so thats working. It just not setting the selected="selected" if there are a few options.

    All three forms are the same between the login, sign up and manager pages.

    Any ideas? See call below:

    [!WebLoginPE?  &type=`manager` &customFields=`BranchServices,BranchServiced` &inputHandler=`Services Provided :BranchServices:BranchServices:select multiple:Please Select(Please Select),Functional Capacity Evaluation(Functional Capacity Evaluation),Injury Prevention(Injury Prevention),Labour Market Analysis(Labour Market Analysis),Personal Care and Domestic Needs Assessment(Personal Care and Domestic Needs Assessment),Psychological Services(Psychological Services),Restoration To Community(Restoration To Community),RTW – New Employer(RTW – New Employer),RTW – Same Employer(RTW – Same Employer),Vocational Assessment(Vocational Assessment),Workplace Assessment(Workplace Assessment)||*Locations serviced by this Office:BranchServiced:BranchServiced:select multiple:Please Select(Please Select),<optgroup label="---State VIC---">,------1. Melbourne(Melbourne),------2. South West(South West),------3. West(West),------4. North(North),------5. North East(North East),------6. Gippsland(Gippsland),(State),<optgroup label="---State NSW/ACT---">,------1. Sydney(Sydney),------2. Central Coast(Central Coast),------3. Hunter(Hunter),------4. North Coast(North Coast),------5. New England(New England),------6. North Western(North Western),------7. Central Tablelands(Central Tablelands),------8. South Coast(South Coast),------9. ACT(ACT),------10. Riverina(Riverina),------11. Murray(Murray),(State),<optgroup label="---State TAS---">,------1. Southern Region(Southern RegionA),------2. Northern Region(Northern RegionA),(State),<optgroup label="---State QLD---">,------1. Brisbane(Brisbane),------2. Gold Coast(Gold Coast),------3. Sunshine Coast(Sunshine Coas),------4. Southern Region(Southern Region),------5. Central Region(Central Region),------6. Townsville and Mackay(Townsville and Mackay),------7. Cairns(Cairns),------8. Northern Region(Northern Region),(State),<optgroup label="---State SA---">,------1. Adelaide Metropolitan(Adelaide Metropolitan),------2. Hills District(Hills District),------3. Northern District(Northern District),------4. Lower North Region(Lower North Region),------5. Yorke Region(Yorke Region),------6. West Coast Region(West Coast Region),------7. Kangaroo Island(Kangaroo Island),------8. Southern Vales District(Southern Vales District),------9. South Eastern Region(South Eastern Region),------10. Murray Mallee(Murray Mallee),------11. Riverland(Riverland),------12. Far Northern Region(Far Northern Region),(State),<optgroup label="---State NT---">,------1. Darwin(Darwin),------2. Jabiru and Kakadu(Jabiru and Kakadu),------3. Arnhem and Tiwi(Arnhem and Tiwi),------4. Nhulunbuy(Nhulunbuy),------5. Katherine(Katherine),------6. Tennant Creek(Tennant Creek),------7. Alice Springs(Alice Springs),(State),<optgroup label="---State WA---">,------1. Perth(Perth),------2. South Coast(South Coast),------3. Central Coast(South Coast),------4. Eastern Region(Eastern Region),------5. Northern Region(Northern Region)`!]

    This question has been answered by pagalo. See the first response.

    • discuss.answer
      Okay I think I fixed it.

      The manager code in webloginpe.class.php was using stripslashes rather than putting the mutliselect into an array.
      So I dont think this was updated or tested for the new inputhandler?

      All you need to do is change lines 1359 to:
      // $setting = html_entity_decode($setting);
      			$needToSplit = strpos($setting, '||');
      			if ($needToSplit > 0)
      				$viewUser[$column] = explode('||', $setting);
      			$modx->setPlaceholder('view.'.$column, $viewUser[$column]);

      And also change line 1423 to:
      foreach ($inputHandler as $setting)