Skip to content

Commit acae92a

Browse files
committed
Fix for breaking change in Alma Analytics API response
1 parent 2ba11a7 commit acae92a

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

.overcommit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
PreCommit:
1919
TrailingWhitespace:
2020
enabled: true
21-
on_warn: fail
21+
problem_on_unmodified_line: warn
2222
PhpCs:
2323
enabled: true
2424
command: 'vendor/bin/phpcs'

spec/Analytics/RowSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function let()
1313
// We need to be able to handle missing data, so let's assume we have
1414
// a report with three columns, but that we for this row only got data
1515
// for two of the columns (data missing for Column2).
16-
$xml = QuiteSimpleXMLElement::make('<Row xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
16+
$xml = QuiteSimpleXMLElement::make('<Row>
1717
<Column0>0</Column0>
1818
<Column1>col1 content</Column1>
1919
<Column3>col3 content</Column3>

spec/data/analytics_response.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
22
<IsFinished>true</IsFinished>
33
<ResultXml>
4-
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
4+
<rowset>
55
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
66
<xsd:complexType name="Row">
77
<xsd:sequence>

spec/data/analytics_response_part1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ResumptionToken>9672D715A8E2EAAA6F30DD22FC52BE4CCAE35E29D921E0AC8BE8C6734C9E1571B4E48EEFCA4046EFF8CD7D1662C2D0A7677D3AD05EDC3CA7F06182E34E9D7A2F</ResumptionToken>
33
<IsFinished>false</IsFinished>
44
<ResultXml>
5-
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
5+
<rowset>
66
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
77
<xsd:complexType name="Row">
88
<xsd:sequence>

spec/data/analytics_response_part2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
22
<IsFinished>false</IsFinished>
33
<ResultXml>
4-
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
4+
<rowset>
55
<Row>
66
<Column0>0</Column0>
77
<Column1>Elkins, James</Column1>

spec/data/analytics_response_part3.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><report><QueryResult>
22
<IsFinished>true</IsFinished>
33
<ResultXml>
4-
<rowset xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
4+
<rowset>
55
<Row>
66
<Column0>0</Column0>
77
<Column1>Parham, Peter 1950-</Column1>

src/Analytics/Report.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function fetchBatch($attempt = 1, $chunkSize = null)
122122

123123
$this->readColumnHeaders($results);
124124

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

127127
foreach ($rows as $row) {
128128
$this->resources[] = $this->convertToResource($row);

src/Analytics/Row.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct(QuiteSimpleXMLElement $data, $headers)
1717
{
1818
$this->headers = $headers;
1919
foreach ($headers as $idx => $header) {
20-
$value = $data->text('rowset:Column' . ($idx + 1)) ?: null;
20+
$value = $data->text('Column' . ($idx + 1)) ?: null;
2121
$this->byIndex[$idx] = $value;
2222
$this->byHeader[$header] = $value;
2323
}

src/Bibs/Holding.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function isInitialized($data)
5353
}
5454

5555
/**
56-
* Load MARC record onto this Bib object. Chainable method.
56+
* Update the MARC record on this holding object. Chainable method.
5757
*
5858
* @param string $xml
5959
*
@@ -87,7 +87,7 @@ protected function urlBase()
8787
}
8888

8989
/**
90-
* Get the MARC record.
90+
* Get the MARC record for this holding object.
9191
*/
9292
public function getRecord()
9393
{

0 commit comments

Comments
 (0)