Errors thrown when logging a datastream usage

Project:RUcore Statistics
Version:6-x
Component:Code
Category:bug report
Priority:normal
Assigned:chadmills
Status:closed
Description

If the datastreamID is not in the correct case an error is thrown by the update_download method.

An example is:

<a href="http://rep-test.libraries.rutgers.edu/rucore/api/stats/update_download/?key=statsupdate&amp;system=&amp;host_ip=108.35.111.130&amp;host_name=pool-108-35-111-130.nwrknj.fios.verizon.net&amp;object=rutgers-lib:26579&amp;mine_type=application/pdf&amp;data_stream=pdf-1" title="http://rep-test.libraries.rutgers.edu/rucore/api/stats/update_download/?key=statsupdate&amp;system=&amp;host_ip=108.35.111.130&amp;host_name=pool-108-35-111-130.nwrknj.fios.verizon.net&amp;object=rutgers-lib:26579&amp;mine_type=application/pdf&amp;data_stream=pdf-1">http://rep-test.libraries.rutgers.edu/rucore/api/stats/update_download/?...</a>

Where the datastream ID is 'pdf-1'. If it were 'PDF-1' no error is thrown.

Since access to datastreams is normally via outputds.php the php_error log will have the following warning.

[02-Aug-2012 21:49:50] PHP Warning: file(<a href="http://rep-test.libraries.rutgers.edu/rucore/api/stats/update_download/?key=statsupdate&amp;system=&amp;host_ip=108.35.111.130&amp;host_name=pool-108-35-111-130.nwrknj.fios.verizon.net&amp;object=rutgers-lib:26579&amp;mine_type=application/pdf&amp;data_stream=pdf-1" title="http://rep-test.libraries.rutgers.edu/rucore/api/stats/update_download/?key=statsupdate&amp;system=&amp;host_ip=108.35.111.130&amp;host_name=pool-108-35-111-130.nwrknj.fios.verizon.net&amp;object=rutgers-lib:26579&amp;mine_type=application/pdf&amp;data_stream=pdf-1">http://rep-test.libraries.rutgers.edu/rucore/api/stats/update_download/?...</a>) [<a href='function.file'>function.file</a>]: failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error
in /mellon/htdocs/dlr/outputds.php on line 182

This is most likely caused by the Notices thrown by the update_download method.

[02-Aug-2012 21:51:37] PHP Notice: Undefined index: object in /mellon/htdocs/rucore/api/stats/statsapi.php on line 709
[02-Aug-2012 21:51:37] PHP Notice: Undefined index: system in /mellon/htdocs/rucore/api/stats/statsapi.php on line 710
[02-Aug-2012 21:51:37] PHP Notice: Undefined index: host_name in /mellon/htdocs/rucore/api/stats/statsapi.php on line 711
[02-Aug-2012 21:51:37] PHP Notice: Undefined index: host_ip in /mellon/htdocs/rucore/api/stats/statsapi.php on line 712
[02-Aug-2012 21:51:37] PHP Notice: Undefined index: data_stream in /mellon/htdocs/rucore/api/stats/statsapi.php on line 716
[02-Aug-2012 21:51:37] PHP Notice: Undefined variable: file_type in /mellon/htdocs/rucore/api/stats/statsapi.php on line 766
[02-Aug-2012 21:51:37] PHP Notice: Undefined variable: resource in /mellon/htdocs/rucore/api/stats/statsapi.php on line 773

Probably making things case-insensitive with update_download is the way to go. Also adding better error handling in outputds.php needs to be implemented.

Comments

#1

Status:active» test

fixed, please test

#2

Assigned to:jgeng» chadmills

#3

Status:test» fixed

I can form this is fixed.

#4

Status:fixed» closed

Back to top