[ckan-dev] CKAN 2.0 under sub-url

Luis eltipicoemail at gmail.com
Wed May 29 11:34:29 UTC 2013


Hi Toby,

Thank you so much for your replies! Your patch completely fixed the issue
:-). Reclinepreview is now fully working (the link I provided before which
didn't work now works as expected!).

Thank you again and have a nice day!

Cheers,


2013/5/29 Toby Dacre <toby.okfn at gmail.com>

> On 29 May 2013 10:53, Toby Dacre <toby.okfn at gmail.com> wrote:
> > On 28 May 2013 20:57, Toby Dacre <toby.okfn at gmail.com> wrote:
> >> On 28 May 2013 20:13, Luis <eltipicoemail at gmail.com> wrote:
> >>> Hi Nigel & User66,
> >>>
> >>> Thank you both for your replies. Setting api_url seems to fix the
> issue :-),
> >>> but unfortunately it breaks reclinepreview extension (I guess). It
> actually
> >>> works with default english language, but if you set it to another one,
> >>> recline stops working. I have an online site so you can check this out:
> >>>
> >>>
> http://taro-des.ull.es/datos/dataset/intermediadores-turisticos/resource/f0c4d85b-f515-4a9b-9a8c-399daa8c26c4
> >>> --- preview ok
> >>>
> >>>
> http://taro-des.ull.es/datos/es/dataset/intermediadores-turisticos/resource/f0c4d85b-f515-4a9b-9a8c-399daa8c26c4
> >>> --- no preview (404 not found)
> >
> > Luis,
> >
> > Does applying the following patch fix the issue for you?
> >
> > diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py
> > index b82be9d..a995666 100644
> > --- a/ckan/lib/helpers.py
> > +++ b/ckan/lib/helpers.py
> > @@ -1494,6 +1494,7 @@ def resource_preview(resource, pkg_id):
> >
> >      if datapreview.can_be_previewed(data_dict):
> >          url = url_for(controller='package',
> action='resource_datapreview',
> > +                      locale='default',
> >                        resource_id=resource['id'], id=pkg_id,
> qualified=True)
> >      elif format_lower in direct_embed:
> >          directly = True
> >
> >
> >
> Sorry that was on master this is on the release-v2.0 branch
>
>
> diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py
> index e601c79..fdb2be9 100644
> --- a/ckan/lib/helpers.py
> +++ b/ckan/lib/helpers.py
> @@ -1496,6 +1496,7 @@ def resource_preview(resource, pkg_id):
>
>      if datapreview.can_be_previewed(data_dict):
>          url = url_for(controller='package', action='resource_datapreview',
> +                      locale='default',
>                        resource_id=resource['id'], id=pkg_id,
> qualified=True)
>      elif format_lower in direct_embed:
>          directly = True
>
>
>
> >
> >>>
> >>> My production.ini:
> >>>
> >>> ...
> >>> ckan.api_url = /datos
> >>> ...
> >>>
> >>> And my Apache2 ckan_default:
> >>>
> >>> ...
> >>> WSGIScriptAlias /datos /etc/ckan/default/apache.wsgi
> >>> ...
> >>>
> >>> Could you please tell me if I am doing anything wrong?
> >>>
> >>
> >> no, this appears to be a ckan bug.  it is part of issue
> >> https://github.com/okfn/ckan/issues/913
> >> this will hopefully be fixed shortly.
> >>
> >> Thank you for your report it has been very helpful
> >>
> >>
> >>>
> >>> Cheers,
> >>>
> >>>
> >>>
> >>> 2013/5/27 Nigel Babu <nigel.babu at okfn.org>
> >>>>
> >>>> Hi Luis,
> >>>>
> >>>> We've actually discovered a potential solution for this problem.  Can
> you
> >>>> try setting ckan.api_url = /ckan in your production.ini file?
> >>>>
> >>>> Nigel Babu
> >>>>
> >>>> Developer  |  @nigelbabu
> >>>>
> >>>> The Open Knowledge Foundation
> >>>>
> >>>> Empowering through Open Knowledge
> >>>>
> >>>> http://okfn.org/  |  @okfn  |  OKF on Facebook  |  Blog  |
>  Newsletter
> >>>>
> >>>>
> >>>> CKAN | http://ckan.org/ | @CKANproject | the world’s leading
> open-source
> >>>> data portal platform
> >>>>
> >>>>
> >>>> On 26 May 2013 02:26, User66 <user66 at arcor.de> wrote:
> >>>>>
> >>>>> Hi Luis,
> >>>>>
> >>>>> this is a known issue IMHO without solution.
> >>>>>
> >>>>> See archive:
> >>>>> http://lists.okfn.org/pipermail/ckan-dev/2013-April/004417.html
> >>>>> http://lists.okfn.org/pipermail/ckan-dev/2013-May/004861.html
> >>>>>
> >>>>> Cheers
> >>>>> Ralf
> >>>>>
> >>>>> ----------------ursprüngliche Nachricht-----------------
> >>>>> Von: "Luis" eltipicoemail at gmail.com
> >>>>> An: ckan-dev at lists.okfn.org
> >>>>> Datum: Sat, 25 May 2013 19:27:38 +0100
> >>>>> -------------------------------------------------
> >>>>>
> >>>>> > Hi all,
> >>>>> >
> >>>>> > I have successfully installed CKAN 2.0 under a sub-url (
> >>>>> > http://mydomain.com/ckan) but I have realized there are some
> features
> >>>>> > which
> >>>>> > don't seem to work well.
> >>>>> > If I try to 'add a new dataset' the URL field is not autofilled
> when I
> >>>>> > type
> >>>>> > the title in the 'Create data' step. Furthermore, the 'Upload a
> file'
> >>>>> > link
> >>>>> > doesn't display in the 'Add data' step.
> >>>>> > In my /etc/apache2/sites-available/ckan_default I have:
> >>>>> >
> >>>>> > WSGIScriptAlias /ckan /etc/ckan/default/apache.wsgi
> >>>>> >
> >>>>> > If I edit this to:
> >>>>> >
> >>>>> > WSGIScriptAlias / /etc/ckan/default/apache.wsgi
> >>>>> >
> >>>>> > Everything works as expected (autofilling URL, FileStorage...), so
> I
> >>>>> > guess
> >>>>> > the problem is my CKAN lives in a sub-url. Is there any solution
> for
> >>>>> > this
> >>>>> > or is this the expected behaviour?
> >>>>> >
> >>>>> > Thank you!
> >>>>>
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> ckan-dev mailing list
> >>>>> ckan-dev at lists.okfn.org
> >>>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
> >>>>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >>>>
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> ckan-dev mailing list
> >>>> ckan-dev at lists.okfn.org
> >>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
> >>>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >>>>
> >>>
> >>>
> >>> _______________________________________________
> >>> ckan-dev mailing list
> >>> ckan-dev at lists.okfn.org
> >>> http://lists.okfn.org/mailman/listinfo/ckan-dev
> >>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >>>
> >>
> >>
> >>
> >> --
> >> Toby Dacre
> >>
> >> The Open Knowledge Foundation
> >>
> >> Empowering through Open Knowledge
> >> http://okfn.org/  |  @okfn
> >
> >
> >
> > --
> > Toby Dacre
> >
> > The Open Knowledge Foundation
> >
> > Empowering through Open Knowledge
> > http://okfn.org/  |  @okfn
>
>
>
> --
> Toby Dacre
>
> The Open Knowledge Foundation
>
> Empowering through Open Knowledge
> http://okfn.org/  |  @okfn
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130529/d7e05de1/attachment-0001.html>


More information about the ckan-dev mailing list