Skip to content

Commit 352098d

Browse files
fixes bug where retrieve_url is modified in place, increments result ids properly in solr_retrieve_list
1 parent a0b26f4 commit 352098d

28 files changed

Lines changed: 2852 additions & 1364 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.4] - 2018-10-29
8+
### Fixed
9+
- List retrieval returns a repeating list of just the first record.
10+
- List retrieval fails to increment the EDS result id.
11+
712
## [1.0.3] - 2018-10-18
813
### Changed
914
- Citation style and export links can now be removed entirely or replaced by specifying regular expressions in several configuration options that can include ruby erb variable expressions for an item's `dbid` and `an`. This was added to address situations where customer proxy urls are returned. See: [Citation link replacement](https://github.com/ebsco/edsapi-ruby/wiki/Citation-link-replacement)
@@ -70,6 +75,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7075
### Added
7176
- Adds KW (keywords) and SH (subject heading) to solr search fields
7277

78+
[1.0.4]: https://github.com/ebsco/edsapi-ruby/compare/1.0.3...1.0.4
7379
[1.0.3]: https://github.com/ebsco/edsapi-ruby/compare/1.0.2...1.0.3
7480
[1.0.2]: https://github.com/ebsco/edsapi-ruby/compare/1.0.1...1.0.2
7581
[1.0.1]: https://github.com/ebsco/edsapi-ruby/compare/1.0.0...1.0.1

lib/ebsco/eds/session.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,12 @@ def solr_retrieve_previous_next(options = {})
459459
def solr_retrieve_list(list: [], highlight: nil)
460460
records = []
461461
if list.any?
462-
list.each { |id|
462+
list.each.with_index(1) { |id, index|
463463
dbid = id.split('__',2).first
464464
accession = id.split('__',2).last
465-
records.push retrieve(dbid: dbid, an: accession, highlight: highlight, ebook: @config[:ebook_preferred_format])
465+
current_rec = retrieve(dbid: dbid, an: accession, highlight: highlight, ebook: @config[:ebook_preferred_format])
466+
current_rec.eds_result_id = index
467+
records.push current_rec
466468
}
467469
end
468470
r = empty_results(records.length)
@@ -795,6 +797,8 @@ def do_request(method, path:, payload: nil, attempt: 0) # :nodoc:
795797

796798
conn = connection
797799

800+
config_path = path.dup
801+
798802
# use a citation api connection?
799803
if path.include?(@config[:citation_exports_url]) || path.include?(@config[:citation_styles_url])
800804
conn = citation_connection
@@ -805,18 +809,18 @@ def do_request(method, path:, payload: nil, attempt: 0) # :nodoc:
805809
when :get
806810
unless payload.nil?
807811
qs = CGI.unescape(payload.to_query(nil))
808-
path << '?' + qs
812+
config_path << '?' + qs
809813
end
810-
req.url path
814+
req.url config_path
811815
when :post
812816
unless payload.nil?
813817
json_payload = JSON.generate(payload)
814-
path << get_cache_id(path, json_payload) if @use_cache
818+
config_path << get_cache_id(path, json_payload) if @use_cache
815819
req.body = json_payload
816820
end
817-
req.url path
821+
req.url config_path
818822
else
819-
raise EBSCO::EDS::ApiError, "EBSCO API error: Method #{method} not supported for endpoint #{path}"
823+
raise EBSCO::EDS::ApiError, "EBSCO API error: Method #{method} not supported for endpoint #{config_path}"
820824
end
821825
end
822826
resp.body

lib/ebsco/eds/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module EBSCO
22
module EDS
3-
VERSION = '1.0.3'
3+
VERSION = '1.0.4'
44
end
55
end

test/cassettes/citation_test/profile_1/test_all_citation_exports_for_a_list_of_ids.yml

Lines changed: 52 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cassettes/citation_test/profile_1/test_all_citation_styles_for_a_list_of_ids.yml

Lines changed: 50 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cassettes/citation_test/profile_1/test_book_citations.yml

Lines changed: 69 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cassettes/citation_test/profile_1/test_citations_include_doi.yml

Lines changed: 69 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cassettes/citation_test/profile_1/test_citations_keep_links.yml

Lines changed: 69 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cassettes/citation_test/profile_1/test_citations_links_and_db_templates_in_exports.yml

Lines changed: 73 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cassettes/citation_test/profile_1/test_citations_links_replace_links_in_styles.yml

Lines changed: 72 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)