remote added content breaks when using locally served content

Bug #845763 reported by Jason Etheridge
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Status tracked in Main
2.1
Fix Released
Undecided
Unassigned
Main
Fix Released
Undecided
Unassigned

Bug Description

On a working system using OpenLibrary for added content,

This will return an image:
wget http://localhost/opac/extras/ac/jacket/small/0130652083

We can clear the entry from memcached with something like this:
memrm --server=127.0.0.1 ac.jacket.small.0130652083

If we then create a directory structure like so:
mkdir -p /openils/var/web/opac/extras/ac/jacket/small/

And make a file like this:
echo hello world > /openils/var/web/opac/extras/ac/jacket/small/foo

We can fetch it with:
wget http://localhost/opac/extras/ac/jacket/small/foo

But now this results in a 404:
wget http://localhost/opac/extras/ac/jacket/small/0130652083

The issue traces back to handler in AddedContent.pm and how it uses $r->filename and $r->path_info.

11:51 < eeevil> so, can we, in fact, move the local added content somewhere else and tell the AC module to use that other location for the local files?
11:52 < phasefx> so in the case above, /openils/var/web/opac/extras/ac/jacket/small/0130652083 does not exist.. and there's no path_info to then work with. We could add logic to work
                 with filename or unparsed_uri at that point instead of path_info
11:53 < tsbere> A simple rewriterule may be able to give the added content system an alternate variable to look at
11:53 < tsbere> Instead of path_info
11:54 * phasefx isn't opposed
11:55 < tsbere> Say something like: RewriteRule ^/opac/extras/(ac/.*)$ - [ENV:AC_PATH_INFO:$1]

Tags: pullrequest
Revision history for this message
George Duimovich (george-duimovich) wrote :

Thanks for identifying this Jason.

FWIW, I believe the original changeset that introduced this functionality is here:

http://svn.open-ils.org/trac/ILS/changeset/15105

Revision history for this message
Jason Etheridge (phasefx) wrote :
tags: added: pullrequest
Revision history for this message
Liam Whalen (lwhalen) wrote :

I have applied this patch to our dev server.

Evergreen 2.0.8
Postgres 9.0.4
OpenSRF 2.0.1
Ubuntu 10.04

It does make our local content display properly. However, when it is applied our content from OpenLibrary.pm no longer shows up.

Revision history for this message
Jason Etheridge (phasefx) wrote :

I've pushed a re-based version of this branch for master but haven't otherwise changed it.

I've also pushed collab/phasefx/local_content_fix_rel_2_1 and collab/phasefx/local_content_fix_rel_2_0

Liam, could you give it another try? I know you were missing Dan's recent OpenLibrary fix before.

Thanks!

-- Jason

Revision history for this message
Liam Whalen (lwhalen) wrote :

I've tested this on our Evergreen 2.1.1 development server, and the local content book covers now display in the search results. The do not display in the individual item records. Are they supposed to?

Revision history for this message
Liam Whalen (lwhalen) wrote :

I should mention that our OpenLibrary content now works at the same time as our local content on the dev server.

Revision history for this message
Dan Scott (denials) wrote :

Verified that the fix corrects the described problem (thanks for the test case, Jason!) and pushed to master through rel_2_0.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.