We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the fetched XML contains only one position, the array that "fetchFeedItems" will return doesn't contain one entry but a flat array of the properties. This is a side-effect of the "json_decode(json_encode())" trick as discussed here: #https://stackoverflow.com/questions/23766159/php-simplexml-arrays-generated-differently-for-single-child-and-multiple-child#comment36552222_23767934
It can be solved by simply using a foreach to loop over the result. It doesn't look that fancy but it works :-)
change
if ($response->getStatusCode() === 200 && strpos($response->getHeaderLine('Content-Type'), 'text/xml') === 0) { $content = $response->getBody()->getContents(); return json_decode( json_encode( simplexml_load_string($content, 'SimpleXMLElement', LIBXML_NOCDATA) ),TRUE )['position']; }
to
if ($response->getStatusCode() === 200 && strpos($response->getHeaderLine('Content-Type'), 'text/xml') === 0) { $xmlContent = simplexml_load_string($response->getBody()->getContents(), 'SimpleXMLElement', LIBXML_NOCDATA); $jobs = []; foreach($xmlContent as $xmlJob){ $jobs[] = (array)$xmlJob; } return $jobs; }
in PersonioService.php L40 ff
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When the fetched XML contains only one position, the array that "fetchFeedItems" will return doesn't contain one entry but a flat array of the properties.
This is a side-effect of the "json_decode(json_encode())" trick as discussed here: #https://stackoverflow.com/questions/23766159/php-simplexml-arrays-generated-differently-for-single-child-and-multiple-child#comment36552222_23767934
It can be solved by simply using a foreach to loop over the result. It doesn't look that fancy but it works :-)
change
to
in PersonioService.php L40 ff
The text was updated successfully, but these errors were encountered: