Commit 6544052e1ab24566cfa889b19ec441a3d9b8fc94
1 parent
9b88323b
Exists in
master
and in
4 other branches
Fix CDAWeb RemoteData filter by instrument type
Showing
1 changed file
with
9 additions
and
2 deletions
Show diff stats
src/REMOTEDATA/CDAWEB.php
... | ... | @@ -141,9 +141,16 @@ class CDAWEB extends RemoteDataCenterClass |
141 | 141 | foreach ($datasets as $ds) { |
142 | 142 | |
143 | 143 | $datasetId = $ds->getElementsByTagName("Id")->item(0)->nodeValue; |
144 | - $insType = $ds->getElementsByTagName("InstrumentType")->item(0)->nodeValue; | |
144 | + $insTypeNodes = $ds->getElementsByTagName("InstrumentType"); | |
145 | + $validInstrumentType = FALSE; | |
146 | + foreach ($insTypeNodes as $insTypeNode) { | |
147 | + if (in_array ($this->html_encode($insTypeNode->nodeValue), $this->validInstrumentTypes )) { | |
148 | + $validInstrumentType = TRUE; | |
149 | + break; | |
150 | + } | |
151 | + } | |
145 | 152 | |
146 | - if (in_array ($this->html_encode($insType), $this->validInstrumentTypes )) { | |
153 | + if ($validInstrumentType) { | |
147 | 154 | |
148 | 155 | $id = $ds->getElementsByTagName("Id")->item(0)->nodeValue; |
149 | 156 | ... | ... |