Commit 3cab1250 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Vincent Pelletier

knowledge pad predicate should be evaluated on real_context, not knowledge pad itself.

parent 9e36364a
......@@ -50,7 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>layout = []\n
<value> <string>if real_context is None:\n
real_context = context\n
layout = []\n
added_box_ids = []\n
all_box_ids = []\n
boxes = context.contentValues(portal_type = \'Knowledge Box\', \n
......@@ -58,7 +60,7 @@ boxes = context.contentValues(portal_type = \'Knowledge Box\', \n
isAnon = context.portal_membership.isAnonymousUser()\n
validation_state_map = {1: (\'public\',),\n
0: (\'visible\', \'invisible\', \'public\',)}\n
boxes = filter(lambda x: x.getValidationState() in validation_state_map[isAnon] and x.test(context), boxes)\n
boxes = filter(lambda x: x.getValidationState() in validation_state_map[isAnon] and x.test(real_context), boxes)\n
for box in boxes:\n
all_box_ids.append(box.getId())\n
\n
......@@ -88,7 +90,7 @@ return layout\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>real_context=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -54,7 +54,7 @@
\'portal-column\');\n
id python: \'portal-column-%s\' %pad_column">\n
\n
<tal:block define="layout active_knowledge_pad/KnowledgePad_getBoxColumnLayout"\n
<tal:block define="layout python:active_knowledge_pad.KnowledgePad_getBoxColumnLayout(real_context=here)"\n
condition="python: len(layout)>=pad_column+1"\n
replace="structure python:\n
active_knowledge_pad.KnowledgePad_viewColumnWidget(section_layout=layout[pad_column], \n
......
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