Ticket #1401 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Some links don't take account when CKAN is mounted at a non-root URL

Reported by: flofokus Owned by: rgrp
Priority: minor Milestone: ckan-sprint-2012-01-23
Component: ckan Keywords: ux
Cc: augusto.herrmann@… Repository: ckan
Theme: deployment

Description

if you want your ckan to reside not at http://yourhost.org/ but rather e.g. at http://yourhost.org/ckan/ you can use this hint http://wiki.pylonshq.com/display/pylonsdocs/Configuration+Files and set ckan.site_url accordingly in your .ini. However, there are some instances where internal links are created without the required prefix.

Change History

comment:1 Changed 3 years ago by rgrp

  • Milestone changed from ckan-v1.5 to ckan-v1.6

Hi, this is very useful to hear. Can you point out links or even better submit a patch / pull request: http://wiki.ckan.org/Submitting_a_code_patch

comment:2 Changed 2 years ago by dread

Another problem is 401 redirect when your not authorized to do something, like creating a group. The redirect URL is set in the who.ini:

login_form_url= /user/login

comment:3 Changed 2 years ago by dread

  • Cc augusto.herrmann@… added

Patch from Augusto Herrmann for the icon URLs: http://pastebin.com/aRBQmftL

comment:4 Changed 2 years ago by dread

When javascript calls other scripts, it misses the mount-point prefix. e.g. application.js has hard-coded URL /api/2/util/is_slug_valid

The URL prefix is stored in request.environSCRIPT_NAME? so perhaps this value should be put in the HTML somewhere for the javascript to get at?

comment:5 Changed 2 years ago by dread

  • Summary changed from some links lack the site_url prefix to Some links don't take account when CKAN is mounted at a non-root URL

comment:6 Changed 2 years ago by dread

  • Keywords ux added
  • Owner changed from flofokus to zephod
  • Status changed from new to assigned

Links have been fixed on branch defect-1401-mount-non-root. (Instead of using c.site_url the links now just detect the mount url like the rest of the links.)

Now it needs the js and css to be fixed too. Reassigning to Tom for this.

Brazilians currently waiting for this to be fixed.

comment:7 Changed 2 years ago by rgrp

  • Owner changed from zephod to rgrp
  • Milestone changed from ckan-v1.6 to current-ckan-sprint-2012-01-23

comment:8 Changed 2 years ago by rgrp

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed. See https://github.com/okfn/ckan/commit/7088b1fcae685e56a280ec7b396b0f9803a477d9

@dread: not at all clear why we had to change from g.site_url to h.url_for (idea was people could set site_url if the site was not at root ...)

comment:9 Changed 2 years ago by dread

  • Status changed from closed to reopened
  • Resolution fixed deleted

Basic check of the home page shows the CSS has not been fixed:

GET http://127.0.1.1/img/find.png 404 (Not Found)
GET http://127.0.1.1/img/share.png 404 (Not Found)
GET http://127.0.1.1/img/collaborate.png 404 (Not Found)

comment:10 Changed 2 years ago by rgrp

  • Status changed from reopened to closed
  • Resolution set to fixed

Thanks for that dread. Have now fixed these issues as well: https://github.com/okfn/ckan/commit/abb99cae9972d45f4b3acfbf8ea711da398d8a4a

Re-closing.

Note: See TracTickets for help on using tickets.