Bug 18175 - Makefile sets koha-httpd api path incorrectly for standard installs
Summary: Makefile sets koha-httpd api path incorrectly for standard installs
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-27 11:39 UTC by Alex Sassmannshausen
Modified: 2020-01-06 20:14 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18175: Use Makefile variable for api path. (1.23 KB, patch)
2017-02-27 11:45 UTC, Alex Sassmannshausen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Sassmannshausen 2017-02-27 11:39:50 UTC
When performing a standard (or single) install, Makefile.PL generates an koha-httpd.conf with a hardcoded ../api/$1/app.pl reference.

This error causes all REST api routes to fail in a standard/single install context.  GET fails with 404, PUT fails with 403.

The hard-coded path is correct in the dev context.

Switching from an Apache variable to a Makefile variable, and hence replacing the hardcoded ../api bit of the path should fix this.

Alex
Comment 1 Alex Sassmannshausen 2017-02-27 11:45:16 UTC
Created attachment 60700 [details] [review]
Bug 18175: Use Makefile variable for api path.

* etc/koha-httpd.conf: Use __API_CGI_DIR__ instead of
  %{DOCUMENT_ROOT}/../api.

Test plan:

Confirming the problem:
- Do a standard install of Koha
- Test any REST API route.
- The route will error out.

Confirming the resolution:
- Apply this patch.
- Do a standard install of Koha
- Test any REST API route.
- The route will work.

Confirming no regression:
- Apply this patch.
- Do a dev install of Koha
- Test any REST API route.
- The route will work.
Comment 2 Alex Buckley 2018-10-29 22:44:10 UTC
Hi there

Sorry this patch is not applying cleanly on master (as the below output shows), can you please either rebase the patch or define the Koha version this patch should be used on?

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 18175: Use Makefile variable for api path.
Using index info to reconstruct a base tree...
M	etc/koha-httpd.conf
Falling back to patching base and 3-way merge...
Auto-merging etc/koha-httpd.conf
CONFLICT (content): Merge conflict in etc/koha-httpd.conf
Failed to merge in the changes.
Patch failed at 0001 Bug 18175: Use Makefile variable for api path.
The copy of the patch that failed is found in:
   /home/vagrant/kohaclone/.git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-18175-Use-Makefile-variable-for-api-path-cy4MsZ.patch


Cheers,
Alex
Comment 3 Martin Renvoize 2019-01-07 09:48:48 UTC
I 'think' this problem has gone away now..  going to mark as resolved.
Comment 4 David Cook 2019-01-07 23:22:34 UTC
(In reply to Martin Renvoize from comment #3)
> I 'think' this problem has gone away now..  going to mark as resolved.

I think we fixed it with https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21031.