fix unwanted schema calls
fix unwanted schema calls


Former-commit-id: 9d266fd87ed07650704948b36f2ca15865b40869

--- a/alaveteli/exportAgencies.csv.php
+++ b/alaveteli/exportAgencies.csv.php
@@ -58,7 +58,11 @@
                     $otherBodies = array_merge($otherBodies, $agency->value->foiBodies);
                 }
                 if (isset($agency->value->positions)) {
-                    $otherBodies = array_merge($otherBodies, $agency->value->positions);
+                    $positions = Array();
+                    foreach ($agency->value->positions as $position) {
+                        $positions[] = "Office of the ".$position;
+                    }
+                    $otherBodies = array_merge($otherBodies, $positions);
                 }
                 sort($otherBodies);
                 if (count($otherBodies) > 0) {

--- a/getAgency.php
+++ b/getAgency.php
@@ -9,7 +9,11 @@
 if (strpos($key, "_") === 0 || $key== "metadata") return;
         echo "<tr>";
 
-        echo "<td>" . $schemas['agency']["properties"][$key]['x-title'] . "<br><small>" . $schemas['agency']["properties"][$key]['description'] . "</small></td><td>";
+        echo "<td>";
+        if (isset($schemas['agency']["properties"][$key])) {
+             echo $schemas['agency']["properties"][$key]['x-title'] . "<br><small>" . $schemas['agency']["properties"][$key]['description']."</small>";
+        }
+         echo                "</td><td>";
         if (is_array($value)) {
             echo "<ol>";
             foreach ($value as $subkey => $subvalue) {