Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r245 - registry/trunk/app/Model

Subject: COmanage Developers List

List archive

[comanage-dev] r245 - registry/trunk/app/Model


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r245 - registry/trunk/app/Model
  • Date: Fri, 2 Mar 2012 20:19:52 -0500

Author: marie
Date: 2012-03-02 20:19:52 -0500 (Fri, 02 Mar 2012)
New Revision: 245

Modified:
registry/trunk/app/Model/CoNsfDemographic.php
Log:
co266 undefined index notices from REST edit

Modified: registry/trunk/app/Model/CoNsfDemographic.php
===================================================================
--- registry/trunk/app/Model/CoNsfDemographic.php 2012-03-02 23:28:54
UTC (rev 244)
+++ registry/trunk/app/Model/CoNsfDemographic.php 2012-03-03 01:19:52
UTC (rev 245)
@@ -74,37 +74,44 @@

public function extractOptions($d, $full = false) {
global $cm_lang, $cm_texts;
+ $val = array();

// Retrieve all possible options for race
$raceOptions = $cm_texts[ $cm_lang ]['en.nsf.race'];
$disabilityOptions = $cm_texts[ $cm_lang ]['en.nsf.disab'];

// Extract selected values for race into array of single characters
- $raceValues = str_split($d['race']);
+ if(isset($d['race']))
+ {
+ $raceValues = str_split($d['race']);

- // Iterates through string
- if($full)
- {
- foreach($raceValues as $c)
- $val['race'][] = $raceOptions[$c];
+ // Iterates through string
+ if($full)
+ {
+ foreach($raceValues as $c)
+ $val['race'][] = $raceOptions[$c];
+ }
+ else
+ {
+ foreach($raceValues as $c)
+ $val['race'][] = $c;
+ }
}
- else
- {
- foreach($raceValues as $c)
- $val['race'][] = $c;
- }

// Extract values for disability into array of single characters
- $disValues = str_split($d['disability']);
+ if(isset($d['disability']))
+ {
+ $disValues = str_split($d['disability']);

- // Iterates through string
+ // Iterates through string

- if($full)
- foreach($disValues as $c)
- $val['disability'][] = $disabilityOptions[$c];
- else
- foreach($disValues as $c)
- $val['disability'][] = $c;
+ if($full)
+ foreach($disValues as $c)
+ $val['disability'][] = $disabilityOptions[$c];
+ else
+ foreach($disValues as $c)
+ $val['disability'][] = $c;
+ }

return $val;
}



  • [comanage-dev] r245 - registry/trunk/app/Model, svnlog, 03/02/2012

Archive powered by MHonArc 2.6.16.

Top of Page