Update to fix first form part
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 1 Dec 2015 20:41:43 +0000 (15:41 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 1 Dec 2015 20:41:43 +0000 (15:41 -0500)
Need different varliable names. Was stomping on it.

controllers/front.php

index 17f069c..5a4c33a 100644 (file)
@@ -154,6 +154,7 @@ class staffords_employment_front
             }
             break;
         default:
+            echo '<p>Part default</p>';
             unset($_SESSION['glmJobsApplication'], $_SESSION['glmJobsAppForm']);
             if ($jobId = filter_var($_REQUEST['job'], FILTER_VALIDATE_INT)) {
                 $jobData  = get_post($jobId);
@@ -168,10 +169,10 @@ class staffords_employment_front
                     $termArray[] = $term->name;
                 }
                 if ( !empty( $termArray ) ) {
-                    foreach ( $form as $key => $formPart ) {
-                        if ( is_array( $formPart[0] ) && $formPart[0]['name'] == 'location_preference' ) {
+                    foreach ( $form as $key => $formPartSub ) {
+                        if ( is_array( $formPartSub[0] ) && $formPartSub[0]['name'] == 'location_preference' ) {
                             foreach ( $termArray as $termName ) {
-                                foreach ( $formPart[0]['opts'] as $optkey => $option ) {
+                                foreach ( $formPartSub[0]['opts'] as $optkey => $option ) {
                                     if ( $option['label'] == $termName ) {
                                         $form[$key][0]['opts'][$optkey]['checked'] = 'checked';
                                     }