{"action":"created","issue":{"url":"https://api.github.com/repos/divio/django-cms/issues/3644","labels_url":"https://api.github.com/repos/divio/django-cms/issues/3644/labels{/name}","comments_url":"https://api.github.com/repos/divio/django-cms/issues/3644/comments","events_url":"https://api.github.com/repos/divio/django-cms/issues/3644/events","html_url":"https://github.com/divio/django-cms/issues/3644","id":50866590,"number":3644,"title":"multi-site page_url fails when missing locale for other site's page","user":{"login":"LeGast00n","id":4689595,"avatar_url":"https://avatars.githubusercontent.com/u/4689595?v=3","gravatar_id":"","url":"https://api.github.com/users/LeGast00n","html_url":"https://github.com/LeGast00n","followers_url":"https://api.github.com/users/LeGast00n/followers","following_url":"https://api.github.com/users/LeGast00n/following{/other_user}","gists_url":"https://api.github.com/users/LeGast00n/gists{/gist_id}","starred_url":"https://api.github.com/users/LeGast00n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeGast00n/subscriptions","organizations_url":"https://api.github.com/users/LeGast00n/orgs","repos_url":"https://api.github.com/users/LeGast00n/repos","events_url":"https://api.github.com/users/LeGast00n/events{/privacy}","received_events_url":"https://api.github.com/users/LeGast00n/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/divio/django-cms/labels/needs%20more%20info","name":"needs more info","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-03T17:25:59Z","updated_at":"2015-02-21T08:22:15Z","closed_at":null,"body":"Hi there,\r\n\r\nFirstly, keep up the great work !!\r\n\r\nI've got a 2-site installation running and I just discovered a bug with page resolution when one site is trying to refer to a page on the other site while this page does not exist with the required locale.\r\n\r\nThe below shows the trace of site 2 trying to reverse a page of site 1. The issue happens on line 8 of the template below, when page_url is called.\r\n\r\nKind regards\r\nLAI\r\n\r\n\r\nEnvironment:\r\n\r\n\r\nRequest Method: GET\r\nRequest URL: http://hr2d.net/en/\r\n\r\nDjango Version: 1.6.6\r\nPython Version: 2.7.8\r\nInstalled Applications:\r\n('djangocms_admin_style',\r\n 'djangocms_text_ckeditor',\r\n 'django.contrib.auth',\r\n 'django.contrib.contenttypes',\r\n 'django.contrib.sessions',\r\n 'django.contrib.admin',\r\n 'django.contrib.sites',\r\n 'django.contrib.sitemaps',\r\n 'django.contrib.staticfiles',\r\n 'django.contrib.messages',\r\n 'cms',\r\n 'mptt',\r\n 'menus',\r\n 'south',\r\n 'sekizai',\r\n 'djangocms_style',\r\n 'djangocms_column',\r\n 'djangocms_file',\r\n 'djangocms_flash',\r\n 'djangocms_googlemap',\r\n 'djangocms_inherit',\r\n 'djangocms_link',\r\n 'djangocms_picture',\r\n 'djangocms_teaser',\r\n 'djangocms_video',\r\n 'reversion',\r\n 'snip_box',\r\n 'event',\r\n 'hr2d',\r\n 'keyurl',\r\n 'carousel',\r\n 'colorfield',\r\n 'pageheader',\r\n 'modeltranslation',\r\n 'surveymonkey',\r\n 'blog')\r\nInstalled Middleware:\r\n('django.contrib.sessions.middleware.SessionMiddleware',\r\n 'django.middleware.csrf.CsrfViewMiddleware',\r\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n 'django.contrib.messages.middleware.MessageMiddleware',\r\n 'django.middleware.locale.LocaleMiddleware',\r\n 'django.middleware.common.CommonMiddleware',\r\n 'cms.middleware.user.CurrentUserMiddleware',\r\n 'cms.middleware.page.CurrentPageMiddleware',\r\n 'cms.middleware.language.LanguageCookieMiddleware',\r\n 'cms.middleware.toolbar.ToolbarMiddleware')\r\n\r\n\r\nTemplate error:\r\nIn template /home/myuser/site1/event/templates/event/event_panel.html, error at line 8\r\n   Reverse for 'pages-details-by-slug' with arguments '()' and keyword arguments '{'slug': ''}' not found. 1 pattern(s) tried: [u'en/(?P<slug>[0-9A-Za-z-_.//]+)/$']\r\n   1 : {% load i18n cms_tags staticfiles sekizai_tags %}\r\n   2 : <div class=\"panel events\">\r\n   3 :   <div class=\"panel-heading\">{% trans \"Events to come\" %}</div>\r\n   4 :   <div class=\"panel-body\">\r\n   5 : \t{% for event in events|slice:\":2\" %}\r\n   6 : \t{% with page=event.page %}\r\n   7 : \t  <div class=\"item event\">\r\n   8 : \t  <a href=\"{% if EVENTS_ROOT_URL %}{{ EVENTS_ROOT_URL }}{% endif %}{% if page %} {% page_url page %} {% endif %}\" style=\"text-decoration: none; color: inherit; font-weight: normal; \">\r\n   9 : \t\t<h2>\r\n   10 : \t\t   {{ event.name }}\r\n   11 : \t\t   {% if event.subname %}<br/>{{ event.subname }}{% endif %}\r\n   12 : \t\t</h2>\r\n   13 : \t\t<p>{{ event.target_audience|safe }}</p>\r\n   14 : \t \t{# Translators: link to learn more about an event in the list #}\r\n   15 : \t \t<a href=\"{% if EVENTS_ROOT_URL %}{{ EVENTS_ROOT_URL }}{% endif %}{% page_url page %}\" class=\"event-more\"><small><span class=\"glyphicon glyphicon-chevron-right\"> </span></small>{% trans 'more' %}</a>\r\n   16 : \t  </a>\r\n   17 : \t  </div> <!-- event-panel -->\r\n   18 : \t{% endwith %}\r\n\r\n\r\nTraceback:\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/core/handlers/base.py\" in get_response\r\n  137.                 response = response.render()\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/response.py\" in render\r\n  105.             self.content = self.rendered_content\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/response.py\" in rendered_content\r\n  82.         content = template.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  140.             return self._render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  134.         return self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/loader_tags.py\" in render\r\n  123.         return compiled_parent._render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  134.         return self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/core.py\" in render\r\n  106.         return self.render_tag(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py\" in render_tag\r\n  76.         rendered_contents = nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/core.py\" in render\r\n  106.         return self.render_tag(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/templatetags/cms_tags.py\" in render_tag\r\n  682.         rendered_contents = nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  506.         output = self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/loader_tags.py\" in render\r\n  62.             result = block.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/core.py\" in render\r\n  106.         return self.render_tag(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/templatetags/cms_tags.py\" in render_tag\r\n  319.             content = get_placeholder_content(context, request, page, name, inherit, nodelist)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/templatetags/cms_tags.py\" in get_placeholder_content\r\n  238.         content = render_placeholder(placeholder, context, name)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/plugin_rendering.py\" in render_placeholder\r\n  158.     content.extend(render_plugins(plugins, context, placeholder, processors))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/plugin_rendering.py\" in render_plugins\r\n  85.         out.append(plugin.render_plugin(context, placeholder, processors=processors))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/models/pluginmodel.py\" in render_plugin\r\n  198.             return render_plugin(context, instance, placeholder, template, processors, context.current_app)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/plugin_rendering.py\" in render_plugin\r\n  56.         content = render_to_string(template, context_instance=context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/loader.py\" in render_to_string\r\n  169.         return t.render(context_instance)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  140.             return self._render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  134.         return self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  196.                         nodelist.append(node.render(context))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/core.py\" in render\r\n  106.         return self.render_tag(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/helpers.py\" in render_tag\r\n  78.         data = self.get_context(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/templatetags/cms_tags.py\" in get_context\r\n  375.                 processors=processors\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/models/pluginmodel.py\" in render_plugin\r\n  198.             return render_plugin(context, instance, placeholder, template, processors, context.current_app)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/plugin_rendering.py\" in render_plugin\r\n  56.         content = render_to_string(template, context_instance=context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/loader.py\" in render_to_string\r\n  169.         return t.render(context_instance)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  140.             return self._render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  134.         return self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  196.                         nodelist.append(node.render(context))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/core.py\" in render\r\n  106.         return self.render_tag(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/helpers.py\" in render_tag\r\n  78.         data = self.get_context(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/templatetags/cms_tags.py\" in get_context\r\n  375.                 processors=processors\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/models/pluginmodel.py\" in render_plugin\r\n  198.             return render_plugin(context, instance, placeholder, template, processors, context.current_app)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/plugin_rendering.py\" in render_plugin\r\n  56.         content = render_to_string(template, context_instance=context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/loader.py\" in render_to_string\r\n  169.         return t.render(context_instance)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  140.             return self._render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  134.         return self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  196.                         nodelist.append(node.render(context))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/core.py\" in render\r\n  106.         return self.render_tag(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/helpers.py\" in render_tag\r\n  78.         data = self.get_context(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/templatetags/cms_tags.py\" in get_context\r\n  375.                 processors=processors\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/models/pluginmodel.py\" in render_plugin\r\n  198.             return render_plugin(context, instance, placeholder, template, processors, context.current_app)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/plugin_rendering.py\" in render_plugin\r\n  56.         content = render_to_string(template, context_instance=context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/loader.py\" in render_to_string\r\n  169.         return t.render(context_instance)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  140.             return self._render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  134.         return self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  196.                         nodelist.append(node.render(context))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  506.         output = self.nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  305.                 return nodelist.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  840.                 bit = self.render_node(node, context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  78.             return node.render(context)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/core.py\" in render\r\n  106.         return self.render_tag(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/classytags/helpers.py\" in render_tag\r\n  39.             value = self.get_value(context, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/templatetags/cms_tags.py\" in get_value\r\n  166.                 url = page.get_absolute_url(language=lang)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/utils/functional.py\" in _curried\r\n  15.         return _curried_func(*(args + moreargs), **dict(kwargs, **morekwargs))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/db/models/base.py\" in get_absolute_url\r\n  1009.     return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.model_name), func)(self, *args, **kwargs)\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/cms/models/pagemodel.py\" in get_absolute_url\r\n  162.         return reverse('pages-details-by-slug', kwargs={\"slug\": path})\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/core/urlresolvers.py\" in reverse\r\n  536.     return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))\r\nFile \"/home/myuser/.virtualenvs/ve_2/lib/python2.7/site-packages/django/core/urlresolvers.py\" in _reverse_with_prefix\r\n  456.                              (lookup_view_s, args, kwargs, len(patterns), patterns))\r\n\r\nException Type: NoReverseMatch at /en/\r\nException Value: Reverse for 'pages-details-by-slug' with arguments '()' and keyword arguments '{'slug': ''}' not found. 1 pattern(s) tried: [u'en/(?P<slug>[0-9A-Za-z-_.//]+)/$']\r\n"},"comment":{"url":"https://api.github.com/repos/divio/django-cms/issues/comments/75361824","html_url":"https://github.com/divio/django-cms/issues/3644#issuecomment-75361824","issue_url":"https://api.github.com/repos/divio/django-cms/issues/3644","id":75361824,"user":{"login":"LeGast00n","id":4689595,"avatar_url":"https://avatars.githubusercontent.com/u/4689595?v=3","gravatar_id":"","url":"https://api.github.com/users/LeGast00n","html_url":"https://github.com/LeGast00n","followers_url":"https://api.github.com/users/LeGast00n/followers","following_url":"https://api.github.com/users/LeGast00n/following{/other_user}","gists_url":"https://api.github.com/users/LeGast00n/gists{/gist_id}","starred_url":"https://api.github.com/users/LeGast00n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeGast00n/subscriptions","organizations_url":"https://api.github.com/users/LeGast00n/orgs","repos_url":"https://api.github.com/users/LeGast00n/repos","events_url":"https://api.github.com/users/LeGast00n/events{/privacy}","received_events_url":"https://api.github.com/users/LeGast00n/received_events","type":"User","site_admin":false},"created_at":"2015-02-21T08:22:14Z","updated_at":"2015-02-21T08:22:14Z","body":"Hi there,\n\nI haven’t looked into it any further since my post. I’ll update to 3.0.10 and give it a try.\n\nbests\nLA\n\n\n> Le 20 févr. 2015 à 22:25, Martin Koistinen <notifications@github.com> a écrit :\n> \n> @LeGast00n <https://github.com/LeGast00n> is this still an issue for you in recent builds? Like, for example, 3.0.10? Please advise.\n> \n> —\n> Reply to this email directly or view it on GitHub <https://github.com/divio/django-cms/issues/3644#issuecomment-75321799>.\n> \n\n"}}