Skip to content

Commit

Permalink
Fix for breaking change in Alma Analytics API response
Browse files Browse the repository at this point in the history
  • Loading branch information
danmichaelo committed Oct 1, 2019
1 parent 2ba11a7 commit acae92a
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
PreCommit:
TrailingWhitespace:
enabled: true
on_warn: fail
problem_on_unmodified_line: warn
PhpCs:
enabled: true
command: 'vendor/bin/phpcs'
Expand Down
2 changes: 1 addition & 1 deletion spec/Analytics/RowSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function let()
// We need to be able to handle missing data, so let's assume we have
// a report with three columns, but that we for this row only got data
// for two of the columns (data missing for Column2).
$xml = QuiteSimpleXMLElement::make('<Row xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
$xml = QuiteSimpleXMLElement::make('<Row>
<Column0>0</Column0>
<Column1>col1 content</Column1>
<Column3>col3 content</Column3>
Expand Down
2 changes: 1 addition & 1 deletion spec/data/analytics_response.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
<IsFinished>true</IsFinished>
<ResultXml>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<rowset>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
<xsd:complexType name="Row">
<xsd:sequence>
Expand Down
2 changes: 1 addition & 1 deletion spec/data/analytics_response_part1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ResumptionToken>9672D715A8E2EAAA6F30DD22FC52BE4CCAE35E29D921E0AC8BE8C6734C9E1571B4E48EEFCA4046EFF8CD7D1662C2D0A7677D3AD05EDC3CA7F06182E34E9D7A2F</ResumptionToken>
<IsFinished>false</IsFinished>
<ResultXml>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<rowset>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
<xsd:complexType name="Row">
<xsd:sequence>
Expand Down
2 changes: 1 addition & 1 deletion spec/data/analytics_response_part2.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
<IsFinished>false</IsFinished>
<ResultXml>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<rowset>
<Row>
<Column0>0</Column0>
<Column1>Elkins, James</Column1>
Expand Down
2 changes: 1 addition & 1 deletion spec/data/analytics_response_part3.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
<IsFinished>true</IsFinished>
<ResultXml>
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
<rowset>
<Row>
<Column0>0</Column0>
<Column1>Parham, Peter 1950-</Column1>
Expand Down
2 changes: 1 addition & 1 deletion src/Analytics/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function fetchBatch($attempt = 1, $chunkSize = null)

$this->readColumnHeaders($results);

$rows = $results->all('//rowset:Row');
$rows = $results->all('//Row');

foreach ($rows as $row) {
$this->resources[] = $this->convertToResource($row);
Expand Down
2 changes: 1 addition & 1 deletion src/Analytics/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(QuiteSimpleXMLElement $data, $headers)
{
$this->headers = $headers;
foreach ($headers as $idx => $header) {
$value = $data->text('rowset:Column' . ($idx + 1)) ?: null;
$value = $data->text('Column' . ($idx + 1)) ?: null;
$this->byIndex[$idx] = $value;
$this->byHeader[$header] = $value;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Bibs/Holding.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function isInitialized($data)
}

/**
* Load MARC record onto this Bib object. Chainable method.
* Update the MARC record on this holding object. Chainable method.
*
* @param string $xml
*
Expand Down Expand Up @@ -87,7 +87,7 @@ protected function urlBase()
}

/**
* Get the MARC record.
* Get the MARC record for this holding object.
*/
public function getRecord()
{
Expand Down

0 comments on commit acae92a

Please sign in to comment.