PublicaMundi / ckanext-publicamundi

PublicaMundi main CKAN extension
http://publicamundi.eu
Other
13 stars 12 forks source link

manage dataset error: Exception: menu item `dataset_translate` cannot be found #230

Closed torle1f closed 7 years ago

torle1f commented 7 years ago

Greetings, I am trying to get an instance of CKAN publicaMundi set up for a demonstration of input/edit/search/view/export of ISO metadata. This is part of an initiative here at the National Center for Atmospheric Research in Boulder, CO USA to get all of our historical datasets to be online and searchable. After discovering that publicaMundi is based on CKAN 2.2 I have been able to get CKAN sort of working with the extension. :) However, if I input a dataset and then try to 'manage' it, I get a Server Error: Exception: menu item dataset_translate cannot be found I wonder if this is a known issue that has been solved?

I'm using ckan 2.2.1 from https://github.com/PublicaMundi/ckan publicaMundi from https://github.com/PublicaMundi/ckanext-publicamundi OS is Debian Jessie 8.6 Python 2.7.8

plugins loaded: ckan.plugins = stats text_preview recline_preview datastore publicamundi_dataset spatial_metadata spatial_query

Any advice would be greatly appreciated! Tor Mohling tor@ucar.edu

drmalex07 commented 7 years ago

Hello Tor,

Can you post the full stack trace for this particular error?

As a workaround, can you try deleting this line at https://github.com/PublicaMundi/ckanext-publicamundi/blob/master/ckanext/publicamundi/templates/package/edit_base.html#L8 ? It seems that the template (wrongly) assumes that multilingual datasets are always enabled (ie plugin publicamundi_multilingual_dataset instead of publicamundi_dataset).

torle1f commented 7 years ago

Greetings,

Thank you so much for your reply and I sincerely apologize for the delay in my response - I was out on vacation.

I have attached a stacktrace.

I will also try removing the line from the ckanext/publicamundi/templates/package/edit_base.html file. I did try to use publicamundi_multilingual_dataset at one point, thinking that this might solve the issue.

On Fri, Oct 7, 2016 at 1:28 AM, MichailAlexakis notifications@github.com wrote:

Can you post the full stack trace for this particular error?

As a workaround, can you try deleting this line at https://github.com/ PublicaMundi/ckanext-publicamundi/blob/master/ckanext/publicamundi/ templates/package/edit_base.html#L8 ? It seems that the template (wrongly) assumes that multilingual datasets are always enabled (ie plugin publicamundi_multilingual_dataset instead of publicamundi_dataset).

Thanks again!

-tor

Tor Mohling -- System Administrator National Center for Atmospheric Research Research Application Laboratories 303.497.2867 tor@ucar.edu

URL: http://ral-ckan-dev.rap.ucar.edu:5000/dataset/edit/tor-s-test-dataset Module weberror.errormiddleware:162 in call

app_iter = self.application(environ, sr_checker) Module webob.dec:147 in call resp = self.call_func(req, _args, _self.kwargs) Module webob.dec:208 in call_func return self.func(req, _args, _kwargs) Module fanstatic.publisher:234 in call return request.get_response(self.app) Module webob.request:1053 in get_response application, catch_exc_info=False) Module webob.request:1022 in call_application app_iter = application(self.environ, start_response) Module webob.dec:147 in call resp = self.call_func(req, _args, _self.kwargs) Module webob.dec:208 in call_func return self.func(req, _args, _kwargs) Module fanstatic.injector:54 in call response = request.get_response(self.app) Module webob.request:1053 in get_response application, catch_exc_info=False) Module webob.request:1022 in call_application app_iter = application(self.environ, start_response) Module beaker.middleware:73 in call return self.app(environ, start_response) Module beaker.middleware:155 in call return self.wrap_app(environ, session_start_response) Module routes.middleware:131 in call response = self.app(environ, start_response) Module pylons.wsgiapp:125 in call response = self.dispatch(controller, environ, start_response) Module pylons.wsgiapp:324 in dispatch return controller(environ, start_response) Module ckan.lib.base:346 in call res = WSGIController.call(self, environ, start_response) Module pylons.controllers.core:221 in call response = self._dispatch_call() Module pylons.controllers.core:172 in _dispatch_call response = self._inspect_call(func) Module pylons.controllers.core:107 in _inspect_call result = self._perform_call(func, args) Module pylons.controllers.core:60 in _perform_call return func(args) Module ckan.controllers.package:848 in edit extra_vars={'stage': vars['stage']}) Module ckan.lib.base:224 in render loader_class=loader_class) Module pylons.templating:249 in cached_template return render_func() Module ckan.lib.base:161 in render_template return render_jinja2(template_name, globs) Module ckan.lib.base:104 in render_jinja2 return template.render(extra_vars) Module jinja2.environment:894 in render return self.environment.handle_exception(exc_info, True) Module /d1/ckan/pm-test/src/ckan/ckan/templates/package/edit.html:1 in top-level template code {% extends 'package/edit_base.html' %} Module /d1/ckan/pm-test/src/ckanext-publicamundi/ckanext/publicamundi/templates/package/edit_base.html:4 in top-level template code {% set pkg_dict = c.pkg_dict %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/package/edit_base.html:4 in top-level template code {% set pkg_dict = c.pkg_dict %} Module /d1/ckan/pm-test/src/ckanext-publicamundi/ckanext/publicamundi/templates/package/base.html:1 in top-level template code {% ckan_extends %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/package/base.html:3 in top-level template code {% set pkg = c.pkg_dict or pkg_dict %} Module /d1/ckan/pm-test/src/ckanext-publicamundi/ckanext/publicamundi/templates/page.html:1 in top-level template code {% ckan_extends %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/page.html:1 in top-level template code {% extends "base.html" %} Module /d1/ckan/pm-test/src/ckanext-spatial/ckanext/spatial/templates/base.html:1 in top-level template code {% ckan_extends %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/base.html:102 in top-level template code {%- block page %}{% endblock -%} Module /d1/ckan/pm-test/src/ckan/ckan/templates/page.html:15 in block "page" {%- block content %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/page.html:18 in block "content" {% block main_content %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/page.html:52 in block "main_content" {% block primary %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/page.html:65 in block "primary" {% block primary_content %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/page.html:67 in block "primary_content" {% block page_header %} Module /d1/ckan/pm-test/src/ckan/ckan/templates/page.html:75 in block "page_header" {% block content_primary_nav %}{% endblock %} Module /d1/ckan/pm-test/src/ckanext-publicamundi/ckanext/publicamundi/templates/package/edit_base.html:8 in block "content_primary_nav" {{ h.build_nav_icon('datasettranslate', ('Translate'), name_or_id=pkg.name, icon='flag-alt') }} Module ckan.lib.helpers:489 in build_nav_icon return _make_menu_item(menu_item, title, **kw) Module ckan.lib.helpers:527 in _make_menu_item raise Exception('menu item %s cannot be found' % menu_item) Exception: menu item dataset_translate cannot be found

CGI Variables AUTH_TYPE 'cookie' CKAN_CURRENT_URL '/dataset/edit/tor-s-test-dataset' CKAN_LANG 'en' CKAN_LANG_IS_DEFAULT True CONTENT_LENGTH '0' CONTENT_TYPE '; charset=utf-8' HTTPACCEPT 'text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8' HTTP_ACCEPT_ENCODING 'gzip, deflate' HTTP_ACCEPT_LANGUAGE 'en-US,en;q=0.5' HTTP_CONNECTION 'keep-alive' HTTP_COOKIE '_ga=GA1.2.787448423.1469028375; utma=34357282.787448423.1469028375.1469484993.1469657995.2; utmz=34357282.1469484993.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=34357282; auth_tkt="deab1214c85b7901d1ea2a1f7412ad3857eeb9c7tor!userid_type:unicode"; ckan=ec4e88f359c80b4593f699090bb42149fb478df79b00e67498684140848053af9e7cf40c' HTTP_DNT '1' HTTP_HOST 'ral-ckan-dev.rap.ucar.edu:5000' HTTP_REFERER 'http://ral-ckan-dev.rap.ucar.edu:5000/dataset/tor-s-test-dataset' HTTP_UPGRADE_INSECURE_REQUESTS '1' HTTP_USER_AGENT 'Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0' PATH_INFO '/dataset/edit/tor-s-test-dataset' REMOTE_ADDR '128.117.192.50' REMOTE_USER u'tor' REMOTE_USER_DATA 'userid_type:unicode' REMOTE_USER_TOKENS [''] REQUEST_METHOD 'GET' SERVER_NAME '0.0.0.0' SERVER_PORT '5000' SERVER_PROTOCOL 'HTTP/1.1'

WSGI Variables no_cache True application <fanstatic.publisher.Delegator object at 0x7effcce825d0> beaker.cache <beaker.cache.CacheManager object at 0x7effcce82350> beaker.get_session <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7effcce82210>> beaker.session {'_accessed_time': 1475770951.353031, '_creation_time': 1475704197.798485} fanstatic.needed <fanstatic.core.NeededResources object at 0x7effa6d1c850> paste.cookies (, '_ga=GA1.2.787448423.1469028375; utma=34357282.787448423.1469028375.1469484993.1469657995.2; utmz=34357282.1469484993.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=34357282; auth_tkt="deab1214c85b7901d1ea2a1f7412ad3857eeb9c7tor!userid_type:unicode"; ckan=ec4e88f359c80b4593f699090bb42149fb478df79b00e67498684140848053af9e7cf40c') paste.httpserver.thread_pool <paste.httpserver.ThreadPool object at 0x7effccdfe590> paste.registry <paste.registry.Registry object at 0x7effa6b7f3d0> paste.throw_errors True pylons.action_method <bound method PackageController.edit of <ckan.controllers.package.PackageController object at 0x7effa6e015d0>> pylons.controller <ckan.controllers.package.PackageController object at 0x7effa6e015d0> pylons.environ_config {'session': 'beaker.session', 'cache': 'beaker.cache'} pylons.pylons <pylons.util.PylonsContext object at 0x7effa6e01250> pylons.routes_dict {'action': u'edit', 'controller': u'package', 'id': u'tor-s-test-dataset'} repoze.who.identity <repoze.who identity (hidden, dict-like) at 139636479388936> repoze.who.logger <logging.Logger object at 0x7effcce74850> repoze.who.plugins {'openid': <OpenIdIdentificationPlugin 139637119470928>, 'friendlyform': <FriendlyFormPlugin 139637226887504>, 'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7effccdf4c50>, 'auth_tkt': <AuthTktCookiePlugin 139637226888400>, 'ckan.lib.authenticator:OpenIDAuthenticator': <ckan.lib.authenticator.OpenIDAuthenticator object at 0x7effcce82790>} routes.cached_hostinfo {'host': 'ral-ckan-dev.rap.ucar.edu:5000', 'protocol': 'http'} routes.route <routes.route.Route object at 0x7effcce89a10> routes.url <routes.util.URLGenerator object at 0x7effa6d1c2d0> webob._parsed_query_vars (GET([]), '') webob.adhoc_attrs {'response': <Response at 0x7effa6d1c410 200 OK>, 'language': 'en-us'} wsgi process 'Multithreaded' wsgiorg.routing_args (<routes.util.URLGenerator object at 0x7effa6d1c2d0>, {'action': u'edit', 'controller': u'package', 'id': u'tor-s-test-dataset'})

torle1f commented 7 years ago

Greetings,

Another follow up on your suggestions for me.

On Fri, Oct 7, 2016 at 1:28 AM, MichailAlexakis notifications@github.com wrote:

As a workaround, can you try deleting this line at https://github.com/ PublicaMundi/ckanext-publicamundi/blob/master/ckanext/publicamundi/ templates/package/edit_base.html#L8 ? It seems that the template (wrongly) assumes that multilingual datasets are always enabled (ie plugin publicamundi_multilingual_dataset instead of publicamundi_dataset).

This workaround was successful, thank you!

-tor

Tor Mohling -- System Administrator National Center for Atmospheric Research Research Application Laboratories 303.497.2867 tor@ucar.edu

drmalex07 commented 7 years ago

Thanks @torle1f

You should probably make your own fork of the code, with the above line deleted. For the time, i will consider this issue as closed.