[Koha-bugs] [Bug 15005] New: (Plack) Use of SCRIPT_NAME makes Koha generate wrong URIs

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 13 15:10:38 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15005

            Bug ID: 15005
           Summary: (Plack) Use of SCRIPT_NAME makes Koha generate wrong
                    URIs
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: gmcharlt at gmail.com
          Reporter: tomascohen at gmail.com
        QA Contact: testopia at bugs.koha-community.org

The current plack-on-packages schema points the apache vhost (for example for
the intranet) like this:

  /cgi-bin/koha/ => /intranet/

So the code that uses ENV{SCRIPT_NAME} "sees" it is being called for example
like /intranet/mainpage.pl. This gets problematic in some scenarios, because it
is used to then redirect the browser, or to create links to things.

Steps to reproduce:
- Check out an old DBRev in the koha repo (1 step older is ok)
- Pick the ansible branch from the kohadevbox [1]
- Launch it, on jessie:
  $ vagrant up jessie
- Log into it
  $ vagrant ssh jessie
- Enable Plack for the automatically created instance
  $ sudo koha-plack --enable kohadev
  $ sudo koha-plack --start  kohadev
  $ sudo service apache2 restart
- Get the DB password to be able to login
  $ koha-pass
- Point your browser to the staff interface:
  http://localhost:8081
- Login with koha_kohadev and the retrieved password
=> FAIL: You cannot login
- Disable Plack for the instance
  $ sudo koha-plack --disable kohadev
  $ sudo koha-plack --stop  kohadev
  $ sudo service apache2 restart
- Point your browser to the staff interface:
  http://localhost:8081
- Login with koha_kohadev and the retrieved password
=> SUCCESS: You can login
- Proceed to install with the default data (you can try enabling plack and you
will notice it works)
- Once you are in, enable plack
  $ sudo koha-plack --enable kohadev
  $ sudo koha-plack --start  kohadev
  $ sudo service apache2 restart
- Checkout the latest master (so it triggers an update)
- Go somewhere inside (about?)
- You are required to login (which is expected)
=> FAIL: the links back are pointing to /intranet/ so they are shortcircuited
to the installer cyclically (see screenshot)

[1] https://github.com/digibib/kohadevbox/tree/ansible

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list