Commit 5edecb55 authored by Ivan Tyagov's avatar Ivan Tyagov

When use creates a default or new tab using a language switch in url (i.e....

When use creates a default or new tab using a language switch in url (i.e. <web_site_url/fr) make sure we set real Web Site context rather than temporary one.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41457 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9ddb772
......@@ -55,7 +55,11 @@
title = pad_title)\n
# for web mode\n
if mode in (\'web_front\', \'web_section\',):\n
pad.setPublicationSectionValue(context)\n
# in Web Mode we can have a temporary Web Site objects created based on current language\n
real_context = context\n
if context.isTempObject():\n
real_context = context.getParentValue()\n
pad.setPublicationSectionValue(real_context)\n
# set it as active\n
context.ERP5Site_toggleActiveKnowledgePad(pad, mode=mode, redirect=False)\n
message = \'Pad added.\'\n
......@@ -105,6 +109,7 @@ return pad.getRelativeUrl()\n
<string>_getattr_</string>
<string>context</string>
<string>pad</string>
<string>real_context</string>
<string>False</string>
<string>message</string>
</tuple>
......
......@@ -94,9 +94,13 @@ if knowledge_pad is None:\n
title = context.Base_translateString(\'Tab 1\'),\n
activate_kw = activate_kw)\n
if is_web_mode:\n
if context.getPortalType() == \'Web Site\' and default_pad_group in (\'\', None,):\n
# in Web Mode we can have a temporary Web Site objects created based on current language\n
real_context = context\n
if context.isTempObject():\n
real_context = context.getParentValue()\n
if real_context.getPortalType() == \'Web Site\' and default_pad_group in (\'\', None,):\n
# script is called within Front Page Gadgets view\n
knowledge_pad.setPublicationSectionValue(context)\n
knowledge_pad.setPublicationSectionValue(real_context)\n
\n
# create a default pad for user belonging to respective pad group\n
# this pad will be available globally for other contexes using the same\n
......@@ -171,6 +175,7 @@ return knowledge_pad.getRelativeUrl()\n
<string>new_id</string>
<string>_getiter_</string>
<string>box</string>
<string>real_context</string>
<string>current_user</string>
<string>str</string>
</tuple>
......
660
\ No newline at end of file
662
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment