biblio.extract_located_uris always returns the URL for "link_text"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
High
|
Dan Scott |
Bug Description
* Evergreen 2.0.6
* PostgreSQL 9.0.4
* Debian Squeeze (database server)
For a record with the following 856:
856 4 0 ‡uhttp:
One would expect asset.uri to be populated with:
href = http://
link_text = To view Windsor's electronic resource click here.
use_restriction = NULL
However, what gets populated is:
href = http://
link_text = http://
use_restriction = NULL
Checking the definition of biblio.
(oils_xpath(
However, running that against this record results in the URI being returned rather than the link text:
SELECT (oils_xpath(
-------
http://
(1 row)
it looks like the XPath results are not necessarily returned in the order they are listed in the XPath expression. http://
So I suspect we'll have to grab the complete array of results and iterate through it to find the first match that does not match uri_href inside the function and assign that to uri_label.
Changed in evergreen: | |
milestone: | none → 2.0.7 |
status: | Fix Committed → Fix Released |
Easier than iterating through the array (although it does work) is to not pull from subfield "u" in the uri_label XPath expression and just assign the value of uri_href to uri_label if uri_label is NULL - as that's effectively what we're doing anyway. Then we can remove the test for uri_label being NULL because it will all come down to uri_href, as it should.